How can separate data and show dynamically?
How can separate data and show dynamically?
Hello.
I have problem on showing many data in datatable.
There are too many data to show in datatable.(There is column including image)
So, when I search data and show, there is delay and even image unloading in Internet Explorer.
To solving that, I think data had to be separated.
- get number of whole data
- set datatable page number about number of data.
- when user click the pagination button, show data about that page.
ex) If paging entries is set 5 and I click '3' page, just show 11st ~ 15th data in datatable. (not getting data except '3' page)
My main question //
Can I set data number before set real data to datatable.
(If I set number 20, page is separated 1 2 3 5 when paging entries is 5)Is there on click function API about pagination button click?
Can I show just that page data keeping paging number?
I'm not good at English. Please understand rambling post.
This question has an accepted answers - jump to answer
Answers
So you want to limit your data to a single page worth? Sounds like you want to do serverSide: true.
The ajax call will automatically pass the information you need on the server to calculate what to send back.
Take a look at https://datatables.net/reference/option/serverSide and https://datatables.net/manual/server-side