Hi All,
I am using jquery datatable for pagination. Using Jquery+ajax+Spring for this page.
From my
jsp page I am giving ajax call to Spring controller, fetching data & data getting displayed for 1st page as shown below:
"success": function (data) {
var tab1 = $("#example").DataTable();
$.each(data, function(i, item) {
//Setting data to datatable
});
}
There are total 37 records in datatable & I am showing 10 records per page so datatable should be showing 4 pages.
At present, only 1 page (first page) is getting displayed as I am retrieving 10 rows from db & have not set total count.
My question is -:
- How to set total no of records to this datatable in above code so that pagination will work & will display 4 pages?
- When I am trying to set recordsTotal in datatable its giving error "Can not reinitialise datatable".
Regards,
Amita