Deleting row on ajax return

Deleting row on ajax return

Cooler123Cooler123 Posts: 15Questions: 2Answers: 0
edited September 2020 in Free community support

i have a table which i fetch from my database. After fetching, i put it in a html table format and then initialize datatable on it.
So the database and datatable are not linked.

row user salary bonus toggle
1 2 20 yes button
2 6 50 no button
3 8 80 yes button

Column salary and user have dropdown filter in header.

Now i have a button in every row of the datatable clicking which toggles the value of bonus in the DATABASE.
So lets say i click on button in row 3, then an ajax call will be made to update the bonus value of this row to 'NO' in DATABASE.
what i want is that if the ajax call is successful then i select row 3 again from database and update row 3 in the datatable.
How do i do this in ajax call? How do i know which row to update?
My data has more than 10000 entries. i dont want that if any filter has been applied using header filters, they get reset. Also i dont want the datatable gets reset to page 1 upon update. If after update that particular row adheres to the header filter then it will be shown or it will be filtered out.

Replies

This discussion has been closed.