webix-hub/docs

how to set value and text to an combo with suggest feature.

Opened this issue · 0 comments

my question is how to set value and text to a combo with suggest feature.
code is like this
{
view: 'combo',
id: 'combo_allusers',
suggest: getSuggest()
}`

getSuggest is a customized method which returns a object as the following:
{
template: '',
scheme: {
$init: function(item) {this.changeId(item.id, item.userId)}
}
dataFeed: {
$proxy: true,
load: function(view, callback, details) {
let $callback = partial(webix.ajax.$callback, view, callback); // partial is from lodash
let mycallback = {
success: function(text, data, loader) {
$callback(text, data, loader, false);
},
error: function(text, data, loader) {
$callback(text, data, loader, true);
}
};
webix.ajax().headers({
'Content-Type' : 'application/json'
}).timeout(2000).get(url, {['userCN']: 'whatever-string'},mycallback);
}
}
}

What I want to do is as:
'$$('combo_allusers').setValue(1);' // 1 is the id that I already know. I can get the text for id 1 as well.
of course this code doesn't help. I read some some message that You cannot ignore the suggest list and enter you own text from docs of 'http://docs.webix.com/desktop__suggest.html'. but I'm not sure if the message means that we don't have any method to set value to a combo with suggest component.