2016-02-25 23 views

回答

0

答案:

var table = $('#table').DataTable(); 
table.init().columnDefs[0].targets; 

Got it here.

謝謝你們!

0

在插件函數調用外部創建一個選項對象非常簡單,只需將整個對象傳遞給該插件函數即可。

var tableOpts = { 
    "targets": [ 4,5,6,7,10,11,14,15 ], 
    "visible": false, 
    "searchable": false 
};  

$(selector).Datatables(tableOpts); 

然後在其他地方的代碼:

alert(tableOpts.searchable)