简体   繁体   中英

Jquery Datatable Page Number Issue

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();


            }


        });

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM