我使用 jquery 数据表,我有 2x 表带有 aoColumns 选项和 1x 没有 aoColumns
所以我想做以下
if(aoColumns != false)
add option in array
我试过了,但没有用
function Data_Table_Function(file,Language,ServerParams,Row_Call_Back,pagation,columns_sort,aoColumnDefs){
var Options_Data_Table = {};
Options_Data_Table = {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": file,
"sPaginationType": "full_numbers",
"bPaginate": true,
"oLanguage": Language,
"iDisplayLength": 25,
"aLengthMenu": [
[10, 25, 50, 100, -1],
[10, 25, 50, 100, "الكل"]
],
"fnServerParams": ServerParams,
"aaSorting": [[ 0, "desc" ]],
"fnRowCallback": Row_Call_Back,
"fnDrawCallback": pagation,
"bInfo": false,
"aoColumnDefs":aoColumnDefs
};
if(columns_sort)
Options_Data_Table.push("aoColumns" : columns_sort);
return Options_Data_Table;
}