Row positioning after row insert
Row positioning after row insert
bbrindza
Posts: 316Questions: 73Answers: 1
Hello,
I am looking for a way to move/position to a newly insert row.
The new row is created using a Bootstrap dialog modal. It inserts the record into db2 data.
When the modal is closed, I destroy and reload the table from a back end PHP script. (Ajax Data).
At this point I would like to position the table to the inserted row.
Bob
This question has an accepted answers - jump to answer
Answers
There are a couple pluginshttps://datatables.net/plug-ins/api/. Look for page.jumpToData() and row().show().
If you are using the
ajax
option you can useajax.reload()
instead of destroying and reloading the table. Another option might be to return the inserted row from the server then userow.add()
to add the row to the table to eliminate the need for reloading everything.Kevin
Sounds good Kevin. Thanks for the tip.