DataTables.Editor.Field
Editor field instance.
Please note - this property requires the Editor extension for DataTables.
The full Editor reference documentation is available to registered users of Editor - the information shown below is a summary only. If you already have an Editor license please sign-in, alternatively an Editor license can be purchased on this site, or sign up for the free trial.
Description
Each field in an Editor form is represented by an DataTables.Editor.Field
object instance. The objects are created automatically when using the fields
initialisation option or the add()
API method. You would not construct a new field instance yourself (it is possible, but it wouldn't serve any purpose since it wouldn't be attached to an Editor form to be used with!).
Fields are initialised using the field-options
data type and have an extensive API available through the field()
method.
Using the field data type API
var editor = new $.fn.dataTable.Editor( {
ajax: '../php/staff.php',
table: '#myTable',
fields: [
{
label: 'Name:',
name: 'name'
}
]
} );
var name = editor.field('name');
name
.def( 'Allan' )
.message( 'Enter user name for the account to update' );