You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: