Right now I just have url: “post->/data/temperatureListByCity” as my url. I followed some of the tutorials about AJAX loading in webix, but couldn’t get it to work. Is there an easy way to add some data to the post requests as to request something specific from the url/database?
var data = webix.ajax().post("/data/temperatureListByCity",{ cityName: curCity });
$$(“tempGrid”).parse(data);
BUT, my sorting/filtering isn’t working anymore (using serverFilter)? Is that because it’s not linked to the URL in the datatable anymore? Is there an easy fix for that?
If you want to send these parameters with filtering and sorting calls you need modify the proxy and save initial loading parameters in datatable object (check the snippet above).
That seems to load in the data a bit better, but the filtering and sorting still isn’t working (it just reloads the entire table when trying to filter). It wasn’t working in the snippet either, is there a line of code that might be missing?
The sample demonstrates how you can pass the necessary parameters (filter and sort alongside with a custom cityName) to server. And it is the task of a server-side script to use them in data queries.
Please check the console to inspect request parameters.
To achieve the necessary behaviour, take “samples/40_serverside/01_php_vanilla/server/datatable.php” script from the downloaded package, change $_GET to $_POST and use it as url for this snippet.
Sorry for not responding quickly, I got busy with some other work, but I got filtering/sorting/etc. working, thanks. Turns out it was because I was getting the info with $_GET instead of $_POST.