How get number of pagination of Datatable?
How get number of pagination of Datatable?
Hello, I have tried to save the page value of a datatable and then send it by POST.
I have been seeing information about it and I have found codes like these:
var table = $ ('# dataTables-example'). DataTable ();
var info = table.page.info ();
var index = info.page + 1;
and fnDrawCallback or fnInfoCallback
... However, it's taking me a while and I thought you guys might already have a code that does that and helps me.
I just need get the page value into an input hidden, then I already know what to do.
Thank you.
Answers
Looks like you have a space between
#
anddataTables-example
invar table = $ ('# dataTables-example'). DataTable ();
. This won't work. It needs to be('#dataTables-example')
for the jQuery selector to work properly.Kevin
Oops, that space was put when translating the text. Originally it was not there.
Does that mean you have it working now?
Kevin