update table and lost page number

update table and lost page number

I have the following code:

            table.clear().draw();
            table.rows.add(data).draw();

which calls every X seconds. But I lose selected page number. How to fix it?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    Answer ✓

    Try this instead:

    table.clear();
    table.rows.add(data).draw(false);
    

    Don't draw after the clear and use draw(false) after rows.add(). The false parameter leaves the table on the current page. Its documented in the draw() docs.

    Kevin

This discussion has been closed.