{hero}

rows().edit()

Since: Editor 1.5.0

Edit multiple existing rows.
Please note - this property requires the Editor extension for DataTables.

Description

This method can be used to edit one or more existing records using the Editor main form. It is essentially a proxy for the edit() method, exposed through the DataTables API object with the rows() selector being used to select the row 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

function rows().edit( options )

Description:

Edit rows in a DataTable using the main Editor form.

Parameters:
Returns:

The original API instance, unmodified, is returned to allow chaining.

Examples

Edit all rows on the current page:

var myTable = $('#myTable').DataTable();

myTable.rows( {page: 'current'} ).edit();

Edit all rows with the class 'selected' - explicitly setting the form title:

var myTable = $('#myTable').DataTable();
var rows = myTable.rows( '.selected' );

rows.edit( {
    title: 'Edit '+rows.count()+' rows'
} );

Edit selected rows, displaying the edit form with a cancel button:

var myTable = $('#myTable').DataTable();
var rows = myTable.rows( '.selected' );

rows.edit( {
    buttons: [
        { label: 'Cancel', fn: function () { this.close(); } },
        'Edit'
    ]
} );

Related

The following options are directly related and may also be useful in your application development.