buttons.buttons.attr
自:Buttons 3.0.0 起
要為按鈕設定的屬性鍵/值集合。
請注意 - 此屬性需要 DataTables 的 Buttons 擴充套件。
描述
此選項提供在文件中按鈕的 HTML 元素上設定任何任意屬性的能力。這對於自訂屬性很有用,例如 ARIA 輔助屬性、設定用於選取/樣式的自訂 id
、自訂資料參數等。
類型
預設值
- 值:
無預設值 (即未定義)
範例
具有標題文字和 id 的複製按鈕
new DataTable('#myTable', {
layout: {
topEnd: {
buttons: [
{
extend: 'copyHtml5',
attr: {
title: 'Copy',
id: 'copyButton'
}
}
]
}
}
});