{hero}

field().focus()

Since: Editor 1.3

Focus on a field.
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 provides the ability to programmatically give focus to a particular field. Different field types have different ways of activating focus (for example a WYSIWYG control is different from a simple text input field). This method abstracts that problem away, with the field type performing a suitable focus for the controls it displays to the end user.

Comments (1)

dbalders@v1.5.018:22, Fri 28th Aug 2015

Another example - Focus on a field on open:

1
2
3
editor.on('open', function() {
    editor.field( 'Field_Name_1' ).focus();
});
allan@v1.5.018:23, Fri 28th Aug 2015

Worth also noting that the focus option of the form-options object can also be used to control which field is focused on, when the form is displayed.

Post new comment

Contributions in the form of tips, code snippets and suggestions for the above material are very welcome. To post a comment, please use the form below. Text is formatted by Markdown.

To post comments, please sign in to your DataTables account, or register:

Any questions posted here will be deleted without being published.
Please post questions in the Forums. Comments are moderated.