fields.className

Since: Editor 1.0

Add an additional class to a field container.
Please note - this property requires the Editor extension for DataTables.

Description

This option will add an additional class name to a field container element, in addition to the other classes that Editor assigned by default. This can be useful for adding styling to certain fields.

As of Editor 1.5, Editor provides additional styling options for fields that controls how it is displayed in the form's layout:

  • full - Use all of the space available to the right of the label for the input element (on larger screens, by default Editor uses white-space to present a simple looking form).
  • block - Show the input element below the label, making use of that additional space to show a larger input control.

The full and block options can both be used on the field to combine their effects.

Type

This option can be given in the following type(s):

Examples

Use the block class to increase the input area of a textarea input field:

var editor = new DataTable.Editor({
	ajax: 'php/staff.php',
	table: '#myTable',
	fields: [
		{
			label: 'Description:',
			name: 'description',
			className: 'block',
			type: 'textarea'
		}
	]
});

Add an custom class to a field container:

var editor = new DataTable.Editor({
	ajax: 'php/staff.php',
	table: '#myTable',
	fields: [
		{
			label: 'First name:',
			name: 'first_name',
			className: 'highlight'
		}
	]
});