buttons.buttons.enabled
自:Buttons 1.0.0 起
設定按鈕的初始啟用狀態。
請注意 - 此屬性需要 DataTables 的 Buttons 擴充功能。
描述
此屬性是功能屬性 buttons.buttons.enabled
的別名,可用於從頂層 DataTables 設定物件設定功能,而不是在 layout
選項中設定(請參閱以下範例)。這允許您使用字串而不是物件來使用此功能,但是如果您使用該功能的多個實例,則會限制配置。有關適用於此選項的完整詳細資訊和選項,請參閱 buttons.buttons.enabled
的文件。
如果您使用的是沒有 layout
選項的 DataTables 1.x,請使用此屬性名稱,但請參考 buttons.buttons.enabled
的文件以獲取完整詳細資訊。
範例
在初始化時停用按鈕
new DataTable('#myTable', {
layout: {
topStart: 'buttons'
},
buttons: ['copy', { extend: 'excel', enabled: false }]
});