editSingle
A button that will edit an existing row using Editor.
Please note - this property requires the Editor extension for DataTables.
Description
This button provides the same functionality and options as the edit
with the sole exception that it is enabled only when a single row is selected in the table. Unlike edit
if multiple rows are selected this button will be shown as disabled (see also selectedSingle
).
This can be useful if your data processing scripts that accept the edited data to be saved into a database do not support multi-row editing.
For full documentation of the options that this button presents, please refer to the edit
reference documentation.
Examples
A single, simple edit button for the Editor instance myEditor
:
new DataTable('#myTable', {
buttons: [
{
extend: 'editSingle',
editor: myEditor
}
]
});
Create, edit and remove buttons, all with default options:
new DataTable('#myTable', {
buttons: [
{ extend: 'create', editor: myEditor },
{ extend: 'editSingle', editor: myEditor },
{ extend: 'remove', editor: myEditor }
]
});