Datatables shows all rows
Datatables shows all rows
freedfox
Posts: 2Questions: 1Answers: 0
Hi !
I'm trying to display only 5 rows on each page, but the datatable keeps displaying all rows on a single page.
I'm linking you the debug link :
http://debug.datatables.net/ilipov
can you explain me what am i doing wrong ? Thanks.
This discussion has been closed.
Answers
You have server-side processing enabled, which means that the server should be limiting the number of rows it returns. Currently it is not, it is returning them all.
If you don't need server-side processing (i.e. you have less that 50k rows) disable it. If you do need it, the server needs to implement the required protocol.
Edit - Reviewing the debug trace a bit more, it looks like it is partly implementing server-side processing. But not fully.
"recordsTotal": "10179"
should be an integer for example and I'm not sure why it is replying with 15 rows, rather than 5. The script would need to be debugged.Allan
In my database I have 10k entries at this moment (but it might be more than 50k in the future). But since I am testing, reloading a page with 10k entries takes a little time so I limited the query to 15 rows.
But the query to know the total records still send back the number of rows in my database.
What I'm trying to do is instead of having my 15 rows (or more) on a single page, having 3 pages (or more) with 5 rows on each.
Thanks for your time.