0

JQueryデータテーブルで私が抱えている問題の概要を次に示します。

a. 私の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
                            });

     });

  }

b. 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 に答える