Datatable (loading data using pagination (where just one page is loaded from server at one) and proxy) - Howto initial sorting

Hi,

how can I apply initial sorting on a datatable, so it is available in my params in the url proxy?

Hi @viktor.machnik.solut

By default, initial data request has no any parameters and uses only provided URL (which will be the base of all further requests).

You can simply add custom parameters for this specific condition in your proxy, but the most cohesive solution will be

  1. set your sorting/filtering parameters to the state of the datatable
  2. then load data with the proxy that will check incoming params; if they’re undefined, use some properties from the state.

Here’s an example with the proxy that gathers all parameters into the request URL: Code Snippet
:small_orange_diamond:Note: unfortunately, the backend in this snippet does not support sorting, so please observe the parameters of requests.