editSingle
自:Editor 1.6.0 起
一個使用 Editor 編輯現有列的按鈕。
請注意 - 這個屬性需要 DataTables 的 Editor 擴充功能。
描述
此按鈕提供與 edit
相同的操作功能和選項,唯一的例外是它僅在表格中選取單列時啟用。 與 edit
不同,如果選取多列,此按鈕將顯示為停用(另請參閱 selectedSingle
)。
如果您的資料處理腳本接受要儲存到資料庫的編輯資料,但不支援多列編輯,這可能會很有用。
如需此按鈕所提供的選項的完整文件,請參閱 edit
參考文件。
範例
Editor 實例 myEditor
的單個簡單 edit 按鈕
new DataTable('#myTable', {
buttons: [
{
extend: 'editSingle',
editor: myEditor
}
]
});
建立、編輯和移除按鈕,全部使用預設選項
new DataTable('#myTable', {
buttons: [
{ extend: 'create', editor: myEditor },
{ extend: 'editSingle', editor: myEditor },
{ extend: 'remove', editor: myEditor }
]
});