How to keep the row selected, before draw table ?

How to keep the row selected, before draw table ?

legal1legal1 Posts: 1Questions: 1Answers: 0
edited April 2020 in Free community support

oTable = $('#dataTable').DataTable( {
"bProcessing": true,
"bServerSide": true,
"rowId" : 'Id',
"select" : {"select" : "single","selector": 'td:last-child',"toggleable": false},
"sAjaxSource":"..."
};
...
rowSelect = oTable.row({selected: true}); //want to keep the selected row before

oTable.draw('full-hold'); // reload the table because the row change
rowSelect.select(); // not ok, the row is deselect

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.