I’m having troubles making suggest work properly with custom proxy (the data comes with jsonp call and needs to be processed, hence the need in custom proxy. Also note, I had to modify webix sources to make jsonp work with not built-in ‘jsonp’ callback but with ‘callback’ callback)
webix.proxy.myCustomProxy = {
$proxy:true,
load:function(view, callback, arg){
if (!arg || !arg.filter || !arg.filter.value) return true;
webix.jsonp('https://ac.cnstrc.com/autocomplete/' + arg.filter.value + '?num_results=50', {}, function (data) {
//console.log(data);
var outArr = [];
if (!data || !data.sections || !data.sections.Products) return true;
for(var i in data.sections.Products){
outArr.push({id:data.sections.Products[i].data.my_id, value:data.sections.Products[i].value});
}
view.parse(outArr);
});
}
};
the only way I could make it work in suggest is by using
{view: “text”, suggest: “myCustomProxy->load.php”}
when I tried anything else like
{view: "text",
suggest: {
body: {
url: "myCustomProxy->load.php"
}
}
}
it simply didn’t worked. But I need to set suggest properties in it’s config, so I would like to know what I did wrong here?