如何解决未显示数据表上的SearchPanes?
现在,我正在尝试在其上添加SearchPanes,因为它允许进行更精细的过滤,例如:
找到2到4个月前“付款日期”的所有贷款 和“支出本金”
这是我的代码(当前试图过滤支出本金: = 10000000):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>View Data Dev Page</title>
<link rel="stylesheet" type="text/css" href="DataTables/datatables.min.css"/>
</head>
<body>
<div class="container">
<div style="background: whitesmoke;padding: 10px;">
<h1 style="margin-top: 0;">View Data</h1>
</div>
<div class="table-responsive">
<table class="table table-bordered" id="table-data1">
<thead>
<tr>
<th>Loan ID</th>
<th>Product Code</th>
<th>Disbursement Date</th>
<th>Disbursement Principal</th>
<th>Outstanding Principal</th>
<th>Last Repayment Date</th>
<th>Next Due Date</th>
<th>Delinquency Days</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<script type="text/javascript" src="DataTables/datatables.min.js"></script>
<script>
var theTable = null;
$(document).ready(function() {
theTable = $('#table-data1').DataTable({
"processing": true,"serverSide": false,"ordering": true,"stateSave": true,"order": [[ 0,'asc' ]],"ajax":
{
"url": "http://localhost/devapi/viewdata.php","type": "GET"
},"sAjaxDataProp": "data","deferRender": true,"searchPane": true,"searchPanes": {
viewTotal: true,columns: [3],},"lengthMenu": [[5,10,20,50],[ 5,50]],"columnDefs":[
{
searchPanes: {
options:[
{
label: '< 10000000',value: function(rowData,rowIdx){
return rowData[3] < 10000000;
}
},{
label: '>= 10000000',rowIdx){
return rowData[3] >= 10000000;
}
}
]
},targets:[3]
}],"columns": [
{ data: "loan_id" },{ data: "product_code" },{ data: "disbursement_date" },{ data: "disbursement_principal" },{ data: "outstanding_principal" },{ data: "last_repayment_date"},{ data: "next_due_date"},{ data: "delinquency_days"}
]
});
});
</script>
</body>
</html>
我没有看到任何SearchPanes。并且检查代码在JS控制台上没有显示任何错误。 怎么了?
顺便说一句,在构建zip包时,我包括了SearchPanes,SearchBuilder和Select扩展名。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。