Plugin for client side searching , filtering ,sorting and server side pagination

Plugin for client side searching , filtering ,sorting and server side pagination

bsharmabsharma Posts: 2Questions: 0Answers: 0
edited May 2013 in General
i have create a plugin for data table by this you can do client side filtering,searching ,sorting and server side pagination .

those who want this source code . mail me at "bbks101@gmail.com".

Replies

  • allanallan Posts: 61,726Questions: 1Answers: 10,109 Site admin
    Sounds very interesting. I'm curious to know how you did that! Perhaps you could put it up as a gist on GitHub or paste bin?

    Allan
  • bsharmabsharma Posts: 2Questions: 0Answers: 0
    edited May 2013
    Hey allan i want to sell this plugin . so can you tell me how can i sell this ? because developers need this.
  • kaustubhkeshavkaustubhkeshav Posts: 3Questions: 0Answers: 0
    edited July 2013
    I agree with @bsharma that this indeed is a useful feature. I have been able to achieve this by just modifying the way my table is being loaded. But maybe there is a easier/better solution. I just wanted to share this, in case someone else also comes across such a requirement.

    1. Make sure you have 2 separate copies of oSettings object, one with bServerSide as true and another with bServerSide as false.
    2. Make sure that you are using the filter API as defined in http://datatables.net/development/filtering for your data table filtering.
    3. Load initial table with a oSettings object which has bServerSide = true and source as a server response. Once rendered, store a local copy of the response object.
    4. On change of the filter, destroy current data table, and create a new one with the other oSettings object having bServerSide as false. Since this settings object isn't loading the data from the server, so you'll need to explicitly add data to it.
    5. Now call fnAddData method and pass the local data source copy created in step 3 to this method.
    6. Then call the fnDraw method. This will re-render your data table with only the data which was shown on the UI initially.
    7. Make sure to call fnDraw method every time you change the filter. As long as the data table is using the settings object for step 4, it will continue to filter the data on client side.
    8. When all filters are cleared, again destroy the data table and create a new one using the original oSettings object which had bServerSide as true. This will make a fresh server call and bring you back to the original state.

    I hope this post was useful.

    Thanks,
    KK
This discussion has been closed.