Row positioning after row insert

Row positioning after row insert

bbrindzabbrindza Posts: 215Questions: 51Answers: 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

Answers

  • kthorngrenkthorngren Posts: 16,400Questions: 25Answers: 3,891

    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 use ajax.reload() instead of destroying and reloading the table. Another option might be to return the inserted row from the server then use row.add() to add the row to the table to eliminate the need for reloading everything.

    Kevin

  • bbrindzabbrindza Posts: 215Questions: 51Answers: 1

    Sounds good Kevin. Thanks for the tip.

Sign In or Register to comment.