Add elements in treeview

HI. Help pls. I have main diagram and palette with tree of elements. When i add element on main diagram i want that element add in tree too. And how i can set location of nodes on diagram without binding. Just several nodes on diagram in different locations

You can have two diagrams observe the same model. This is probably what you want. Simple example:

codepen example

Those models can have different templates, layouts, etc. Maybe one Diagram has the locations data-bound and the other one doesn’t, and uses a Layout instead.

You do not need your second diagram to be a Palette. You can use two Diagrams.

And how i can set location of nodes on diagram without binding.

If you have a reference to a node, you can set its location or position property. For example

// move the first Node in the Diagram to 50,50
myDiagram.startTransaction();
var node = myDiagram.nodes.first();
node.location = new go.Point(50, 50);
myDiagram.commitTransaction();