我想将变量传递给mColumns属性而不是[0,1,2,3,4,5,6,7,8,9],这是我的代码:
$(function() {
var table=$('#MSRRes').dataTable
( {
"oTableTools":
{
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "csv",
"mColumns": [0, 1, 2, 3,4,5,6,7,8,9],
"sAction": "flash_save"
}
]
}
});
});
答案 0 :(得分:1)
你的意思是这样吗?
var someArray=[0, 1, 2, 3,4,5,6,7,8,9];
(function() {
var table=$('#MSRRes').dataTable ( {
"oTableTools":
{
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "csv",
"mColumns": someArray,
"sAction": "flash_save"
}
]
}
});
});