Open wautersj opened 7 years ago
this.options.initSelection = function(element, callback: (data: any) => void) {
callback({id: result.id, text: result.name});
};
That is how I did it. In case if you getting initial value in some async request there is possible to change "data" property right after you set initial selection. I did this:
this.data = [];
Hi!
I'm trying to get get this to work: Data I can select out, is only available when typed in the search box (via ajax). (So no data via [data] attribute). The selected value will be saved.
When, a value was chosen, and the user returns to the view with the Select, that value should be visible in the Select.
When a value changes, I only get the ID. But how can I set the initial value? (I guess I need an object providing both ID, and Text?)
How does this mechanic work?