Is it possible to set for TextBlock behaviour when it’s editable from start. Like on this example Text Editing Examples ?
But combobox should appear after diagram is loaded. Or maybe there is another way to build-in combobox inside gojs node ?
There’s currently no way to build HTML (like a combobox/drop-down) into a GoJS node, but you can create a Panel with shapes that stylistically resembles one.
For instance, we do that with checkboxes here: CheckBoxes
Well, I implemented needed behaviour according to and it’s OK for me.
The one thing is unclear for me - how to handle selection in combobox ?
I need handler with node key and new value which is selected in combobox.
In this function, I need to update something on the server side.
Any ideas how to implement it ?
User clicks node to start TextEditing (the combo-box appears)
A certain value gets set in the combo-box
A user picks a new value in the combo-box
Are you talking about #2 or #3?
In the example, #3 is committed when the user clicks away, but you could also add:
customEditor.addEventListener('change', function(e) {
// do something on each select box change
// maybe use:
var textblock = myDiagram.toolManager.textEditingTool.textBlock;
var node = textblock.part;
var data = node.data;
}, false);
there is no error as was before.
Unfortunately, I can’t get selected value in combobox. In my code,I’m trying to show alert with this value.
How can I do it ?