Server Side Processing to Return Data & Client Side For Filtering

Server Side Processing to Return Data & Client Side For Filtering

jchannonjchannon Posts: 26Questions: 0Answers: 0
edited February 2011 in General
Is it possible to turn server side processing on so that's where it retrieves data but also get DataTables to do the filtering client side?

Replies

  • rewenrewen Posts: 74Questions: 2Answers: 0
    Hi jchannon,

    You can set serverside to false but continue to use ajaxsource. As mentioned in the documentation, this will cause a one-time ajax load of the data, after which all sorting and searching is done clientside
  • jchannonjchannon Posts: 26Questions: 0Answers: 0
    What about paging? I was thinking of using the AJAX for paging so it returns a subset of data and then all filtering/sorting done on the client
  • rewenrewen Posts: 74Questions: 2Answers: 0
    When you do the one-time ajax request it gets *all* of the rows from your server-side source. All the paging is done client-side afterwards. DataTables doesn't send any information to the server to tell it which subset/page of data to send back, since it's designed to get the entire dataset back if serverside == false.

    Having client-side sorting and filtering for only the a single page at a time might be confusing to the user as they probably expect the sorting and filtering to apply to all the data, including the data from other pages.

    Maybe allan has a solution for you but I wouldn't get your hopes up for that particular scenerio, sounds like it would be difficult to get around.
This discussion has been closed.