dougui5419 2018-11-08 07:50
浏览 166

有关于DataTables paggingType =“input”的问题

i'm using datatables and for pagination i've used paggingtype = "input" and also included its plugin cdn but unfortunately when i used this, it is automatically disabling the First Next Previous and Last pagination buttons and i needed them enabled so that i can use them alongwith input text field.. Any help will be a huge favor

Here's my JavaScript:

$(document).ready(function () {
    $('#categories').DataTable({
        "processing" : true,
        "pagingType" : "input",
        "ajax" : {
            "url" : ajaxurl + "/ManageCategories/fetchCategories",
            "type" : "POST"
        }
    });
});

and here's my DataTable showing output: enter image description here

thanks, Ameer

  • 写回答

2条回答 默认 最新

  • doushan5245 2018-11-08 08:01
    关注

    I got a solution to my question i.e. whenever "paggingType" is used it will overwrite the default "paggingType" so in order to get a text input i can add it manually by inserting this javaScript:

    $("div.toolbar").html('<div><input type="text" id="pageJump" placeholder="page"> 
    <button id="jump" type="button">Go</button></div>');
    
    $('#jump').click( function() {
    table.page(parseInt($('#pageJump').val())-1).draw(false);
    }) 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?