How to display last updated row on top followed by rest of the data

How to display last updated row on top followed by rest of the data

ayushforyouayushforyou Posts: 3Questions: 2Answers: 0

After updation of data via ajax, i want to reload the datatable with last updated row on top followed by rest of the data without page refreshing.

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    That's not possible, the ajax reload will always clear the table and add everything. You could 'remember' what was in the table before, and highlight the new rows, but the rows would always be in the current sorted order. One option would be have a hidden column that you tag new rows with, and then sort on that column - you could run that code in xhr

    Colin

  • ayushforyouayushforyou Posts: 3Questions: 2Answers: 0

    Thanx Colin but that possible if we originally sort our column based on updated_at in descending order. then whenever we update any row, then it is reflected on top.

This discussion has been closed.