Datatable draw() serverside and sort, filter, search locally

Datatable draw() serverside and sort, filter, search locally

jigar311982jigar311982 Posts: 70Questions: 31Answers: 0
edited May 2017 in Free community support

Hello,

I am adding values in server with AJAX call and then do draw() to get all values back to datatable view.
Earlier i was using serverside:true, so that all sort, filter, search was done in server, but problem is after pulling data from server i was doing some modification in values like string concatenation and some calculation on numbers. If i do this, then sorting doesn't work correctly because it simply sort server values, not manipulated.

Then i decides to do serverside:false, my sorting problem was resolved, but when i add my values in server with AJAX and run .draw(), then values are not pulled in table because it don't fetch at all,

So i can combine this two functionality together? Is it possible or not at all?

Thank you for support,

Regards...

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,089Questions: 1Answers: 10,388 Site admin
    Answer ✓

    No - sorry. There are a few other threads about this, but basically there is no way to do a hybrid mode in DataTables at the moment.

    The way to handle this would be to use an SQL VIEW which would combine the data into the way you want to display it on the client-side, so it can be correctly sorted and filtered as required.

    Allan

  • efiefi Posts: 1Questions: 0Answers: 0

    Hi,
    I know it's been a while, but if someone came here from Google search, my solution is on my git page.
    https://github.com/efraimGit/DataTablesSrc,

    i added option to draw (and sort) locally even if serverSide is true.

This discussion has been closed.