🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Column.autofocus
This page was created by Stephanie on 2023-05-18. Last edited by Wikiadmin on 2026-07-29.

You use #Column.autofocus to place the keyboard focus in a chosen input column when that column appears in an editable table, so users can start entering data in a new row without selecting the field first.

What #Column.autofocus does

#Column.autofocus is a column setting for an editable table. When MDriven renders a row and the configured column is available for input, focus moves to that column's input control.

Use it when users repeatedly add rows and should begin typing in the same field each time.

For example, an order-entry table may contain Item number, Description, and Quantity columns. If users create a new row by entering an item number first, set #Column.autofocus on the Item number column. After the new row appears, the item-number field receives focus.

Configure autofocus for a table column

  1. Open the ViewModel that contains the editable table in MDriven Designer.
  2. Select the column that represents the field where users should start typing.
  3. Add the #Column.autofocus setting to that column.
  4. Run the view and create a new table row.
  5. Confirm that the input control in the configured column receives focus when the new row appears.

Configure autofocus on the column that is the first meaningful input for the row. In a table used to enter a list of numbers, this is typically the number field rather than a description or calculated-value column.

Example: entering a list of numbers

Assume an editable table has a Value column and an action that adds a row.

  1. The user chooses the action to add a row.
  2. MDriven displays the new row.
  3. Because the Value column has #Column.autofocus, focus moves to the Value input in that new row.
  4. The user can type the next number immediately.

This avoids requiring the user to click the new row before entering each value.

Choose the right autofocus mechanism

Need Use Example
Focus a field in a specific editable table column #Column.autofocus Focus the Item number field after a user adds an order line.
Automatically select an input field when it appears in a view the autofocus tagged value Focus a search field when a view opens.

Related column settings

Use #Column.autofocus for focus behavior, not for the input type or browser autocomplete behavior.

See also