modifier()
Get the identifier for the row(s) currently being edited / removed.
Please note - this property requires the Editor extension for DataTables.
Description
When an Editor instance is displayed to an end user, it can often be useful to know which row is the one being acted upon, particularly if you are using the Buttons or TableTools buttons to provide access to the editing interface.
This method provides exactly this ability, returning the identifier that was used to trigger the edit or remove action. This identifier is the first parameter that was passed to the edit(), inline(), bubble() or remove() methods.
In the case of the Buttons or TableTools buttons, the identifier is:
- On
edit:array- The DataTable row indexes for the rows to be edited - On
remove:array- The DataTable row indexes for the rows to be removed.
Type
modifier()
Get the identifier for the row(s) currently being edited / removed, as was configured by the call to the edit(), inline(), bubble() or remove() methods.
Returns:
Any: Identifier given to the editing / remove methods. null when Editor is in create state.
Example
Get the data for the rows to be edited on the open event:
editor.on('open', function (e, type) {
var modifier = editor.modifier();
if (modifier) {
var data = table.row(modifier).data();
// do something with `data`
}
});