最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JQuery Datatables pagination - Stack Overflow

programmeradmin3浏览0评论

I can't get my pagination to work after I added a date filtering plug-in to datatables. The original code was like this and it was picking up the pagination fine.

$(document).ready(function() {

 $('#table1').dataTable({
  'sPaginationType': 'full_numbers'
 });

this is my current one with the plug in variables

$(document).ready(function() {
 var oTable = $('#table1').dataTable();
 "sPaginationType": "full_numbers"
 /* Add event listeners to the two range filtering inputs */
 $('#min').keyup( function() { oTable.fnDraw(); } );
 $('#max').keyup( function() { oTable.fnDraw(); } );

});

Thanks in advance.

I can't get my pagination to work after I added a date filtering plug-in to datatables. The original code was like this and it was picking up the pagination fine.

$(document).ready(function() {

 $('#table1').dataTable({
  'sPaginationType': 'full_numbers'
 });

this is my current one with the plug in variables

$(document).ready(function() {
 var oTable = $('#table1').dataTable();
 "sPaginationType": "full_numbers"
 /* Add event listeners to the two range filtering inputs */
 $('#min').keyup( function() { oTable.fnDraw(); } );
 $('#max').keyup( function() { oTable.fnDraw(); } );

});

Thanks in advance.

Share Improve this question edited Dec 23, 2016 at 17:58 Colin Brock 21.6k9 gold badges49 silver badges62 bronze badges asked Jan 28, 2011 at 17:36 glennglenn 1432 gold badges4 silver badges14 bronze badges 1
  • I'd remend asking on the Datatables forums. I asked a few questions on there when I was doing some work with the plugin and they were answered quickly. The plugin developer uses the forums too, so somebody there will be able to help. – Ian Stanway Commented Feb 15, 2012 at 12:42
Add a ment  | 

1 Answer 1

Reset to default 4

Well, in your current function, this part:

var oTable = $('#table1').dataTable();
"sPaginationType": "full_numbers"

should be written like this:

var oTable = $('#table1').dataTable({
    'sPaginationType': 'full_numbers'
});

Edit

In case it wasn't clear, the full jQuery code should look like this:

$(document).ready(function() {
    var oTable = $('#table1').dataTable({
        'sPaginationType': 'full_numbers'
    });
    /* Add event listeners to the two range filtering inputs */
    $('#min').keyup( function() { oTable.fnDraw(); } );
    $('#max').keyup( function() { oTable.fnDraw(); } );
});
发布评论

评论列表(0)

  1. 暂无评论