gpt4 book ai didi

javascript - 当我有 60 时,数据表只显示 15

转载 作者:搜寻专家 更新时间:2023-10-31 21:47:22 27 4
gpt4 key购买 nike

我使用 Datatables 1.9.4 和 Jquery : 1.12

我在查看 php 页面时使用数据表来显示数据:

 <table id="table_data" class="datatable table table-hover table-striped table-condensed" data-url='<?php echo site_url('****/***'); ?>'></table>

我创建了一个过滤器来通过 ajax 调用修改数据:

$(document).on("click", "#needtobevalide", function() {
$("#table_data").DataTable({
"processing": true,
"serverSide": true,
"order": [],
"ajax": {
url:"<?php echo base_url();?>index.php/***/*****",
type:"POST"
},
"bDestroy": true
});
});

但是当我点击按钮 needtobevalide 时,数据表填满了 15 行,但是如果我使用 console.log 我的结果我有 60 行

数据表显示:“显示 15 个条目中的第 1 到 10 个”

我也尝试过使用 "iDisplayLength": 60,但没有成功

最佳答案

初始化dataTables后需要添加如下代码

$("#table_data").DataTable({
"paging": false
// then add other attributes here
});

您可以在以下位置阅读更多信息:https://datatables.net/reference/option/paging

替代方法:

包括“bPaginate”:false,作为参数。如此处所示:http://datatables.net/release-datatables/examples/basic_init/filter_only.html

关于javascript - 当我有 60 时,数据表只显示 15,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55948723/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com