Is it possible to invoke client sorting and filtering when using pipelining approach?

Is it possible to invoke client sorting and filtering when using pipelining approach?

sfehersfeher Posts: 3Questions: 1Answers: 0

Hello,

I'm using the pipeling approach to cache the data on the client side. However I'd like to keep the existing client login searching and filtering behavior, rather than deal with it server side.
Is this possible and if yes what do I need to invoke for sorting and filtering ? Thanks.

Sebastian

This question has accepted answers - jump to:

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    The pipeline approach should only be used for serverSide:true, so anything changes that would change the result set should cause the pipeline to reset. At least my implementation of the pipeline does.

  • sfehersfeher Posts: 3Questions: 1Answers: 0
    edited July 2017

    Thanks for your answer Bindrid. I understand that ideally you'd want a change in filter, or a search to bring fresh data from the server. However in my case the requirement is to cache the all server pages - basically turning the paging into a "Get more pages, while keeping existing ones", but not the search and the filter features and let the client do those 2. My question is - how to do invoke that client sorting/filtering behavior while using the pipelining mechanism ?

  • bindridbindrid Posts: 730Questions: 0Answers: 119
    Answer ✓

    I do not think you want to do that. How much data are you talking about? Maybe you should consider serverSide:false, and get all of the data at once.

    Otherwise, you are going to run into all kinds of difficulties. For example, keeping in mind that the pipeline caches 5 pages by default, you would have to search first through those 5 pages, which could end up being only one row found, then still have to go back to the server and search the rest of the data.

    The more I think about it, the more nightmarish it becomes, keeping paging right, total rows found right, filtered right, some of the data to be search on the client, some of the data search still on the server, arrrrrrrgh.

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin
    Answer ✓

    Yup - the whole point of server-side processing is that the server-side does the sorting and filtering. There is no way around that as there isn't designed to be away around it. You either use server-side processing or not.

    The pipeline example is purely a cache. It will not magically allow server-side processing to be mixed with client-side processing. There is no way to do that.

    Allan

  • sfehersfeher Posts: 3Questions: 1Answers: 0
    edited July 2017

    Bindrid, Allan, thank you for your answers.

    There are millions of records stored in S3 (so not indexed). The idea is that for the first load it will show the first 1000 most recent entries, paginated over 10 pages lets say. If they want they could load an additional 1000. The search and filtering is expected to work on the range loaded in the client (they can see the date range above the table), so I was trying to prevent going to the server to filter and search data that is already present in the client. The requirement is NOT to search past the N*1000 already loaded in the client - as in most cases they only want to see the most recent ones and would be less interested past 2-3000 but want to given them the option to go back further if they want to. Would it make more sense to keep it serverSide:false and somehow add the rows if they want to load more? Thanks!

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin
    Answer ✓

    Would it make more sense to keep it serverSide:false and somehow add the rows if they want to load more?

    Yup - spot on. You are using client-side processing from your description. So you can use an Ajax request to get the additional data and rows.add() to add them to the table. Perhaps have a button such as "Load more" to trigger that request.

    The search, sort and filter will only be on the client-side data. But that sounds like it is what you want.

    Allan

This discussion has been closed.