Datatable URL

Hello webix team,

Here for datatable, I’ve used below
this.data.url = “getResult?sessionKey=” + sessionKey+’&data=’+data

but now I’ve to send data in request body instead of header along with below webix paramaters.
start: 0
count: 50
continue: true
sort[name]: asc
filter[name]:

How can I do this? Please provide solution for the same.

Hello, @Pooja

In your datatable as a URL, you could use a function to fetch and parse the data into a widget:

{ view:"datatable", id:"table", autoConfig:true, url:function(params){
    return webix.ajax("some/path");
}};

It’s possible to add request headers with the headers method.

webix.ajax().headers({
    "Content-Type":"application/json"
}).get(url, params);

Please, pay attention, that parameters arrive to function as JSON. For complex parameters to be passed (eg filtration or sorting), they should be transformed into URL parameters for Get request.
The entire process is demonstrated in the snippet below:
https://snippet.webix.com/z29bfwgn