{hero}

field().multiGet()

Since: Editor 1.5

Get the values for a field (multi-row editing aware).
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 , alternatively an Editor license can be purchased on this site, or sign up for the free trial.

Description

This method is specifically designed for Editor's multi-row editing feature. It provides the ability to get the values that a field has for one or more items that are being edited.

To illustrate, consider an Editor instance that has been set up to edit two rows in a DataTable which have the row id's of row_27 and row_31. If there is a field called first_name we might have:

editor.field('first_name').multiGet();

// Result:
//  {
//      "row_27": "Allan",
//      "row_31": "Bob"
//  }

Note how this single field can have multiple values assigned to it for each item being edited. Equally they could both be the same value is the user has edited the value using the Editor UI. The field().isMultiValue() method can be used to determine if a field contains different values for the items being edited or not.

We can also get the value for a single item by passing a parameter into the method:

editor.field('first_name').multiGet( 'row_27' );

// Result:
//  "Allan"

The field().multiSet() method provides the setter version of this method.

Note that there is no field().multiVal() method like there is for single value editing, as such a method's arguments could potentially be ambiguous. Thus the distinction between field().multiGet() and field().multiSet().

In addition to this method, Editor provides a number of other methods that can be used to get and set field values - each with their own speciality. Please refer to the Related selection below for links to these methods.