Reputation: 87
I am using Jquery Datatable in Asp.net Page. As we know that at bottom it shows message like "Showing 1 to 10 of 100" . But i am getting issue that whenever Page size is less than total records then at bottom i always get Message ""Showing 1 to 010 of 100". 0 is getting prefixed before End records. My code is as below
var pagesize = jQuery('#hdpagesize').val();
jQuery('#dyntable').dataTable({
"sPaginationType": "full_numbers",
"iDisplayLength": pagesize,
"aaSortingFixed": [[0, 'asc']],
"aoColumnDefs": [
{ 'bSortable': true, 'aTargets': [1] }
],
"fnDrawCallback": function (oSettings) {
jQuery.uniform.update();
}
});
Upvotes: 1
Views: 738
Reputation: 3120
I believe this is where iDisplayLength
is being processed as a string as opposed to an integer.
Try using parseInt(pagesize, 10)
and see what result is returned.
If that fixes the problem, then try and apply a server-side fix so that pagesize
is processed and served as an integer.
Upvotes: 1