Search
Grid.focusCell Method
See Also
 






Sets the focus to the cell at the specified position.

Namespace: MindFusion.DataViews
File: Grid.js

 Syntax

JavaScript  Copy Code

function focusCell (row, column, moveBackwards)

 Parameters

row

Number. The cell row.

column

Number. The cell column.

moveBackwards

Boolean. True to move backwards.

 Remarks

If the cell at the specified position is not editable, the focus is set to the next editable cell, if such exists.

 Example

The following code calls the focusCell method to bring the cell to be edited in focus:

JavaScript  Copy Code

grid.rowCommand.addEventListener(function (sender, args)
{
    if (args.commandName == "Edit")
    {

    var editRow = args.row;
         initialData = Object.assign({}, grid.model.getRowData(editRow));

         grid.refreshRows(editRow);

         grid.allowEdit = true;
         grid.allowCellSelect = true;

         grid.focusCell(editRow, 0);
     }
}

 See Also