0

这是我在使用 JQuery 数据表时遇到的问题的摘要。

一种。我的 JSP 页面有以下内容:

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

     });

  }

湾。从 body.onload 调用 checkSnapStatus 函数。在 $.get 函数之后,会显示记录(很多),但没有分页。我没有看到上一个或下一个按钮。

4

1 回答 1

1

您使用什么版本的数据表和 jquery?我使用 jquery 1.6.4 和 datatables 1.9.0 以及以下作品 -

$('#snapTable').dataTable({
    "bJQueryUI"      : true,
    "iDisplayLength" : 5,
    "sDom"           : 'T<"clear">lfrtip'
});
于 2012-10-22T17:05:42.693 回答