SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.setFocusedIndex  method

Change Location of cell which has the input focus to the cell specified by parameter index

If index is Invalid Value, it will change before Normalizing first. If focus parameter is true, when the cell which newly has the focus is not displayed in the grid, it will scroll to display the visible location. 

You can check the location of cell which currently has the focus through focusedIndex property. 

function setFocusedIndex (value: CellIndex, focus: Boolean, select: Boolean): this;
Returns
this
Parameters
value - CellIndex. required.
focus - Boolean. Defaults to false.
select - Boolean. Defaults to true.
Code -1
    // Move one row up.
    $('#moveUp').click(function () {
        var index = grid.focusedIndex();
        index.rowIndex--;
        grid.setFocusedIndex(index, true);
    });
    // Move one row down.
    $('#moveDown').click(function () {
        var index = grid.focusedIndex();
        index.rowIndex++;
        grid.setFocusedIndex(index, true);
    });
See Also
focusedIndex
setFocusedRow
setFocusedCell
CellIndex.normalize
GridBase.isValidCell
Examples
Focused Cell