yapkm01
yapkm01

Reputation: 3775

Datatables not showing pagination

Here's the summary of the issue i'm having with JQuery datatables.

a. My JSP page has the following:

<script type="text/javascript" src="../include/jquery.dataTables.js"></script>
<script> 
$(document).ready(function() {
$('#snapTable').dataTable({
   "iDisplayLength": 5,
   "bPaginate": true
   } );
 } )

  :

 function checkSnapStatus() {
 var url = "....";                               // some JSP servlet return HTML table id = 'snapTable'. HTML has a div called  progress_bar
 $.get(url, function(xml) {
            $('#statuscontent').html(xml);      // Put the return HTML into div id='statuscontent' on the body element
            var object = $('div.progress_bar'); // Get the div id=progress_bar elements =
            $.each(object, function() {
                            //process some stuff
                            });

     });

  }

b. The checkSnapStatus function is called from the body.onload. After the $.get function, the records (lots of them) are displayed but there's no pagination. I don't see the previous or next button.

Upvotes: 0

Views: 3452

Answers (1)

saihgala
saihgala

Reputation: 5774

What version of datatables and jquery do you use? I use jquery 1.6.4 and datatables 1.9.0 and following works -

$('#snapTable').dataTable({
    "bJQueryUI"      : true,
    "iDisplayLength" : 5,
    "sDom"           : 'T<"clear">lfrtip'
});

Upvotes: 1

Related Questions