search.dt Event Handler -- Determine the # of Rows in the Results
search.dt Event Handler -- Determine the # of Rows in the Results
WhetDawg
Posts: 5Questions: 2Answers: 0
I need to disable buttons on the page whenever a search results in 0 rows being shown.
var tbl = $('#myTable').DataTable();
tbl.on('search.dt', function (e,settings) {
consoleLog(tbl.rows().length,'# rows'); // How do I determine the # of rows that resulted from the search?
});
Thanks.
This question has an accepted answers - jump to answer
Answers
Use the
selector-modifier
of{ search: "applied" }
.Kevin
Thank you!