Counting rows with data element with paging

Counting rows with data element with paging

collincouchcollincouch Posts: 3Questions: 2Answers: 0

I'm I have a datatable with 1,500 rows. I have paging set and I'm displaying 50 records per page.

I the third element is the data is a checkbox. I'm trying to get the total count of checked checkboxes, but I'm unable to even return the total count of rows

// Find indexes of rows which have checked in the second column
var indexes = dt.rows().eq(0).filter(function (rowIdx) {
return dt.cell(rowIdx, 2).data().indexOf("checked='checked'")>1 ? true : false;
});

//I'll call this function like this
var count = dt.rows(indexes).lengh;

//Unfortunately dt.rows isn't looking in all 1500 rows and only looks at the first 210

Answers

  • colincolin Posts: 9,822Questions: 0Answers: 1,629

    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

Sign In or Register to comment.