I am trying to find the best solution to modify the query sent to the server before filtering/requesting data from the server on a datatable component. The same should apply for dataview and other components.
I figured out that modifying the passed parameters on ‘save’ is straightforward:
and I can add up any number of fields in the post request.
When retrieving data though, that is not so clear on were to access the data to be used in the query. An approach will be with registerFilter but I believe this requires creation on a dummy column.
There are few different solution. You can modify data url from onBeforeFilter handler, that is valid approach, but I think using Data Proxy is the better one
webix.ui({
view:"list",
url:{
proxy:true,
load:function(view, callback, state){
//this code will be used for all data loading calls
//state - filters, and sorting states
webix.ajax("some.php", callback, view);
}
}
})
webix.ajax(this.source, callback, view);