cell().edit()
Edit a cell with inline or bubble editing.
Please note - this property requires the Editor extension for DataTables.
Description
This method can be used to edit a single cell using Editor's inline or bubble editing modes. It is essentially a proxy for the inline()
or bubble()
methods, exposed through the DataTables API object with the cell()
selector being used to conveniently select the cell to be edited.
The Editor instance used by this method is the last Editor instance create that refers to this table when the table was constructed. This consideration is only important when using multiple Editor instances!
Please note that this method only exposes one small part of Editor through the DataTables API. Editor has its own extensive API which provides complete control over the form.
Type
cell().edit( [ type, ] options )
Edit a cell using the inline or bubble editing methods of Editor.
Parameters:
Name | Type | Optional | |
---|---|---|---|
1 | options | Yes - default:inline | |
Editing type to be used. This can be either | |||
2 | options | No | |
Form configuration options, including the ability to set the title, buttons and behaviour of the form. |
Returns:
DataTables.Api
The original API instance, unmodified, is returned to allow chaining.
Examples
Edit the cell clicked upon using inline editing:
var myTable = new DataTable('#myTable');
$('#myTable').on('click', 'tbody td', function () {
myTable.cell(this).edit();
});
Edit the cell clicked upon using bubble editing:
var myTable = new DataTable('#myTable');
$('#myTable').on('click', 'tbody td', function () {
myTable.cell(this).edit('bubble');
});
Edit a cell and submit immediately when blurred:
var myTable = new DataTable('#myTable');
$('#myTable').on('click', 'tbody td', function () {
myTable.cell(this).edit({
blur: 'submit'
});
});
Related
The following options are directly related and may also be useful in your application development.