SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.setFocusedIndex  method

入力フォーカスを持つセルの位置をパラメーターindexで指定したセルに変更する。 

index間違った値であれば、まず正規化の後に変更する。 focusパラメーターがtrueなら新しいフォーカスを持つセルが現在フォーカスに見えない場合、見える位置になるようにスクロールする。 

現在フォーカスを持つセルの位置はfocusedIndexプロパティーでわかる。 

function setFocusedIndex (value: CellIndex, focus: Boolean, select: Boolean): this;
Returns
this
Parameters
value - CellIndex. required.
focus - Boolean. デフォルト値はfalse.
select - Boolean. デフォルト値はtrue.
Code -1
    // 一行上に移動させる。
    $('#moveUp').click(function () {
        var index = grid.focusedIndex();
        index.rowIndex--;
        grid.setFocusedIndex(index, true);
    });
    // 一行下に移動させる。
    $('#moveDown').click(function () {
        var index = grid.focusedIndex();
        index.rowIndex++;
        grid.setFocusedIndex(index, true);
    });
See Also
focusedIndex
setFocusedRow
setFocusedCell
CellIndex.normalize
GridBase.isValidCell
Examples
フォーカスセル