Select and Ajax Reload

Select and Ajax Reload

trongarttrongart Posts: 222Questions: 51Answers: 0

In this test case I use the select extension: https://live.datatables.net/roregoze/1/edit

When selecting multiple rows and clicking on the button Reload Ajax to refresh the table, the selected rows become unselected after the reload. Is there a way to keep the rows selected after the reload?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770
    Answer ✓

    Yes, see this example documenting how to keep the row selections.

    Kevin

  • trongarttrongart Posts: 222Questions: 51Answers: 0

    Resolved with:

    buttons: [
      {
        text: 'Reload Ajax',
        className: "reset_filter_button",
        titleAttr: "Reset all buttons, custom, and search filters",
        action: function ( e, dt, node, config ) {
          var rows = table.rows({selected: true});
          table.ajax.reload(function () {
          rows.select()
          }, false);
        },
      },
    ]
    
Sign In or Register to comment.