Text Editor Select Box Load dynamically choices

The problem is that i want to load choices of select box from server. But the choice expect array, then program gives error.
How to change of choices dynamically?

$(go.TextBlock,{textEditor: window.TextEditorSelectBox, choices: getChoices()})

getChoices() returns like promise so i cant use like that.

Do you want to change the list of choices for all Parts using that editable TextBlock, or just for one particular Node or Link using that editable TextBlock?

For the former case, I suggest that you add a choices property to the Model.modelData object.

For the latter case, I suggest that you add a choices property to each node or link data object. (You don’t make clear if you mean nodes or links or both.)

In your Promise.then function you could then do:

myDiagram.startTransaction();
myDiagram.model.setDataProperty(xxx, "choices", theNewArrayOfStrings);
myDiagram.commitTransaction("new choices");

For the former case, xxx should be myDiagram.model.modelData.

For the latter case, xxx should be myDiagram.model.findNodeDataForKey(key), assuming it’s a node that you want to change and you have its unique key.

Thank you for your answer