SMART datagrid v1.4 > 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
포커스셀