Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
enforceway opened this issue Sep 24, 2016 · 0 comments
Open

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

enforceway opened this issue Sep 24, 2016 · 0 comments

Comments

@enforceway
Copy link

enforceway commented Sep 24, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant