page: 'current' selector-modifier returns too many rows

page: 'current' selector-modifier returns too many rows

molkemonmolkemon Posts: 4Questions: 3Answers: 1

Hello,

in my table i have a drawCallback that calls another function. In this function I use DataTable().rows( { page: 'current' } ).every to do something (doesn't matter). I have pageLength: 10 set, but the current selector returns 20 rows?! This then causes errors in my function, that's how I noticed in the first place...

Table Data is populated via AJAX. I even tried initialising the table as empty and only add data on button press, but this doesn't change anything.

The table itself displays just fine, with 10 rows per page.

If I sort or switch to another page, the current selector correctly returns the 10 new rows.

What do?

This question has an accepted answers - jump to answer

Answers

  • molkemonmolkemon Posts: 4Questions: 3Answers: 1
    Answer ✓

    never mind, I am dumb... the callback function includes another subfunction that executes another draw (once so it doesn't recurse endlessly) which is causing the problems. It doesn't return 20 rows of the data set, it returns the correct 10 rows, but twice....

Sign In or Register to comment.