gpt4 book ai didi

jquery - 基于条件的数据表 oSelectorOpts 选项

转载 作者:行者123 更新时间:2023-12-01 04:48:00 25 4
gpt4 key购买 nike

我正在从数据表中导出所有数据。现在我需要的是一个条件,如果条件为 true,则启用 oSelectorOpts 否则不启用。

这是我的配置代码:

"aButtons": [
{
"bFooter": false,
"fnClick": function ( nButton, oConfig ) {
if(condition)
{
"oSelectorOpts": { page: 'current' };
}
},
'sExtends':'xls',
"sFileName": "Telephone_Directory.xls",
'mColumns':[0,1,2,3]
},

为什么我需要这个,因为有时我会导出所有数据,有时仅导出当前页面数据。有没有其他方法可以实现这一点。请提出建议。

最佳答案

这是我使用的东西,它为您提供 2 个按钮/选项,打印当前页面或打印全部:

  "sDom": '<"clear">T<"clear">lfrtip',
"oTableTools": {
"aButtons": [
{
"sExtends": "print",
"sButtonText": "print page",
"bShowAll": false
},
{
"sExtends": "print",
"sButtonText": "print all",
"bShowAll": true
}
],
"sSwfPath": "//cdn.datatables.net/tabletools/2.2.0/swf/copy_csv_xls_pdf.swf"
},

关于jquery - 基于条件的数据表 oSelectorOpts 选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26112501/

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