<script src="Scripts/datatables.min.js"></script>
<script src="Scripts/bootstrap.min.js"></script>
<script src="Scripts/jquery.dataTables.min.js">
<script src="Scripts/dataTables.buttons.min.js"></script>
<script src="Scripts/dataTables.dateTime.min.js"></script>
<script src="Scripts/buttons.print.min.js"></script>
<script src="Scripts/searchBuilder.bootstrap.js"></script>
$('#tblData').DataTable
(
{
retrieve: true,
scrollY: '56vh',
scrollX: false,
//"pageLength": 15,
"iDisplayLength": 30,
//scrollX: false,
scrollCollapse: true,
//"order": [0, "asc"],
//"ordering": false,
//"pagingType": "full_numbers"
paging: false
//for PDF
, dom: 'Bfrtip',
buttons:
[
//'copyHtml5',
//'excelHtml5',
//'csvHtml5',
//'pdfHtml5',
{
extend: 'copyHtml5',
messageTop: 'As On: ' + customMessage
},
{
extend: 'excelHtml5',
messageTop: 'As On: ' + customMessage
}
,
{
extend: 'csvHtml5',
messageTop: 'As On: ' + customMessage
}
,
{
extend: 'pdfHtml5',
messageTop: 'As On: ' + customMessage
}
,
{
extend: 'searchBuilder',
config: {
depthLimit: 2
}
}
]
//for export Options Ends here.
}
);
搜索生成器按钮与其他按钮一起显示,但当点击搜索生成器按钮时,它会引发错误:
数据表.searchBuilder.min.js:136未捕获的类型错误:此.popover不是s处的函数。操作(dataTables.searchBuilder.min.js:136:109)位于v(index.js:22:1)位于HTML按钮元素。(index. js:22:1)位于HTML按钮元素。分派(jquery-3.5.1.js:5429:27)位于元素数据。句柄(jquery-3.5.1.js:5233:28)操作@ dataTables.searchBuilder.min.js:136 v @ index. js:22(匿名)@ index. js:22分派@ jquery-3.5.1.js:5429元素数据。句柄@ jquery-3.5.1.js:5233
1条答案
按热度按时间piztneat1#
您正在尝试将searchBuilder添加到buttons。数据表使用https://datatables.net/reference/option/dom。这意味着您的
dom: 'Bfrtip',
缺少Q插件。**答案:**dom:亲爱的,