Performance problem with pagination

Performance problem with pagination

irxn84irxn84 Posts: 12Questions: 5Answers: 0

I use a server side datatable. I have a large table with the problem that Select count(*) is very slow for the table (postgres). So I want to have a pagination with Next, previous buttons. This works with pagingType: "simple".

Now I want to get rid of the section Showing 1 to 10 ....
Also the datatable should always show the next button without knowing how much data there really is. When the user clicks next and there is no more data, it is okay that there is no data displayed.

How can I solve this problem?

This question has an accepted answers - jump to answer

Answers

  • rf1234rf1234 Posts: 2,941Questions: 87Answers: 415
    Answer ✓

    You can do that with jQuery. Just take a look at the dom elements data tables generates for this stuff and hide them and enable the next button even when you are on the last page.

    Put these manipulations inside an event handler and you should be done.
    https://datatables.net/reference/event/init

This discussion has been closed.