Can we connect the autosuggest directly to an AJAX call? I am trying this and it’s not working:
{
view: 'combo',
options: {
view:"suggest",
body: {
data: 'api/data' // returns [ "One", "Two", "Three", "Four", "Five", "Six" ]
//data: [ "One", "Two", "Three", "Four", "Five", "Six" ]
}
}
}
maksim
September 28, 2015, 8:57pm
3
if “api/data” is url, you need to change the code like next
{
view: 'combo',
options: {
view:"suggest",
body: {
url: 'api/data'
}
}
}
}
maksim
September 28, 2015, 9:01pm
4
http://webix.com/snippet/6a507b01
Where url returns a valid json data like follows
[
{"id":1,"value":"Afghanistan"},
{"id":2,"value":"Albania"},
{"id":3,"value":"Algeria"}
]
How do I use this combo like suggest textbox http://docs.webix.com/samples/13_form/01_controls/15_suggest_server.html
lookup ajax url on keypress:
http://…server/data.php?filter[value]=rusia
@finzaiko If options are defined as url, server-side filtering will be enabled automatically: http://webix.com/snippet/261c0fcb
But if you need to tune loading behavior (e.g. start search when at least two characters were typed), you need to specify thedataFeed
property of the inner list: http://webix.com/snippet/e37594a9
den
June 7, 2017, 5:52pm
8
how use this combo with server-side filtering, If options I get NOT as a url.
Options I get as a result of running my javascript function.
This javascript function itself refers to the server and can receive no more than 50 entries from server.
webix.ui({
container:"cmb",
view: "combo",
width:300,
suggest: {
keyPressTimeout: "1000",
container:"cmb1",
body:{
yCount:5,
dataFeed: function (text) { Myfunction(text)
}
}
});
Don’t work
My function return json data
@den in the above snippet, load
provides also data parsing after ajax call. Thus, you need to parse
the data from Myfunction
. Something like
https://webix.com/snippet/5ad23d4a