Datatable dynamic loading with filter and sorting

I have looking around and learn about webix about last 3 days.
And I will need a widget (table actually) that can handle thousand datas and load it dynamic based on the the page user chose -> which already supported by current webix.
Buat I found another problem that I will need a feature about filter / sorting on the table with dynamic loading. I try to find it on the webix docs, but I don't have the luck to find it.
Can anyone please is it possible to do filter / sort on the dynamic data loading on datatable?

Comments

  • In case of dynamic loading you can use server side filtering and server side sorting ( that means component will reload data on sorting and filtering )

    Check Server Filter here

    http://docs.webix.com/datatable__filtering.html

    and Server-side Sorting here

    http://docs.webix.com/datatable__sorting.html

  • Hi Maksim, thanks for your answer.
    I have checked the example that provided on the link you gave. But it does not work :
    http://docs.webix.com/samples/40_serverside/01_php_vanila/11_datatable_sort_filter.html
    Seems the problem on server side, because the responses always return the same data whatever filter I typed on the text field.
    Better to make those example works.

    If I check on the response on the filter / sort on server side, the response does not provide the start and count (checked on the example above).
    Because if it does not work together with dynamic, it will lead to problem when I have filter that results are about > 10000 of data.

  • Please ignore the server side part of the sample, it is not working correctly. will fix it later.

    Basically you need to return the same data as was loaded during initial data loading - first chunk of data with total-count defined. If grid will need an extra data for the current page it will issue a new request with all necessary parameters ( count, start, filter, sort )

  • Hi Maksim, thanks for your answer. I will try to implement directly with simple datatable and data.

  • @maksim: I have another question. How we handle the error when dynamic data loading has error? Maybe the user session is end, or the access token lifetime is end?
    Is there any event that I can catch some like after get data from server and before load it to datatable?

  • If it is not enough, you can create a custom proxy object, where you can use any custom code for data loading.

    http://docs.webix.com/desktop__server_proxy.html

  • Thank you very much Maksim.

  • hey filter is not working while use scroll pagination

  • edited July 2016

    filter is not working while

    If you are using built-in filters, their value will be sent along with other data during dynamic data loading requests. So server side code can correctly send only filtered data.

    If it doesn't work for you, please share a sample where it can be checked.

  • Hey, is there any workaround for the serverFilter to make it work with scroll pagination?

  • @knits can you please provide a demo which can illustrate the issue?

    For me, such use-case works as expected. Please check the snippet:

    https://webix.com/snippet/c0ac657b

    Filter the 2nd column (by "contrib" value, for example) and scroll down the table. As far as I can see, grid sends proper requests to the backend.

Sign In or Register to comment.