I'm trying to get the count of the number of rows on the current dataTables page. If I do this:
alert($('.tableViewer tbody tr').length)
It gives me the a non-accurate row count (I think it adds the current page and the last one?).
Anyway, I'm just trying to get the row count on the page I'm actually on. Does anyone know how to do this?
Here's my delete button:
function fnDelete(elem){
if (selected.length>0) {
var c;
c = confirm('Are you sure you want to delete the selected ${displayTableName}?');
if (c) {
// Create delete url from editor url...
var deleteURL = (urlstr.substring(0, urlstr.lastIndexOf('/') + 1)) + "delete.do";
alert($('.tableViewer tbody tr').length)
deleteRecord(deleteURL,selected[0]);
alert($('.tableViewer tbody tr').length)
if ( $('.tableViewer tbody tr').length === 1) {
setTimeout(function() { oTable.fnPageChange('last'); }, 100);
}
}
}
}
$('.tableViewer tbody tr:visible').length