colReorder.disable()
自:ColReorder 1.5.0 起
停用 ColReorder 的互動功能。
請注意 - 此屬性需要 DataTables 的 ColReorder 擴充功能。
描述
此方法可用於停用 ColReorder 終端使用者與 DataTable 的互動。
請注意,為了能夠啟用和停用 ColReorder,DataTable 初始化時必須指定 colReorder
選項。如果未使用 colReorder
,則無法使用此方法來控制 ColReorder 的啟用。
類型
範例
使用按鈕啟用/停用欄位重新排序
var table = new DataTable('#myTable', {
colReorder: true
});
$('#enableReordering').on('click', function () {
table.colReorder.enable(true);
});
$('#disableReordering').on('click', function () {
table.colReorder.disable();
});
相關
以下選項直接相關,也可能在您的應用程式開發中很有用。