Row positioning after row insert

Row positioning after row insert

bbrindzabbrindza 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

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951
    Answer ✓

    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: 316Questions: 73Answers: 1

    Sounds good Kevin. Thanks for the tip.

Sign In or Register to comment.