Sorting using an ajax call

I already have all backend implemented so I’m not able to use the connectors provided with the plugin. So what I did was implement a getList() method in the backend that returns a JSON with all the elements I should render in the grid. Now what I need is apply filters or sorting the list and render again the grid using the getList method. For that what I’m doing is calling a setSort method in the backend that sets the new order criteria (or setFilters method) and after that I should call to getList().

So I wonder how do that, I tried with methods like render(), refresh(), destroy() with no luck. How is the best approach? I can’t send all the rows from the backend due performance issues, we have millions of rows so we’re doing the pagination on the backend. I only need to know how to clean the current grid content and populated again with the getList method.

If you are talking about datatable, it has experimental feature which allows to do so.
You can configure the column in question like next

 columns:[ { id:"title", sort:"server" }, ....

After that, when user sorts grid by column in question, client side code will clear current state and will request new data from server side It will make call to same script, from which initial data was loaded, with extra parameter “sort” which will contain the details about requested sorting mode.

In more common case , you can use code line next to reload data in any data component

some.clearAll();
some.load("data.php"); //new data

Also, the connectors is just one of options. You can achieve all the same functionality with custom code.