I need to return my own JSON to the handler. How can I over ride the handler and do my own AJAX round trip and return the JSON that the handler is looking for.
Hello,
you can define a custom proxy for the needed handler:
var myProxy = {
$proxy: true,
load: function(view, callback, params){
var data = {...}; // get json with the needed data data
view.parse(data)
}
};
webix.ui({
view: "filemanager",
handlers:{
"handler_name": myProxy,
}
});
Thanks
Helga, thanks for helping. I have noticed the above won’t work
You may also try calling default callback, success
and error
depending on server data:
var myProxy = {
$proxy:true,
load:function(view, callback, params){
webix.ajax("url", function(text, res){
//error
callback.error.call(null, text);
//success
callback.success.call(null, text, res);
});
}
};
webix.ui({
view:"filemanager",
handlers:{
"handler_name": myProxy
}
});