SMART datagrid v1.4 > Classes > GridBase

Back  Forward

DataLudi.GridBase.setSelection  method

index1index2 사이의 영역을 style의 형태로 선택한다. 

style을 지정하지 않으면 DisplayOptions.selectStyle 설정을 따른다. focustrueindex1style 설정에 맞춰 포커스셀 위치를 새로 설정한다. index1CellIndex 객체이면 무조건 그 위치에 포커스를 설정하고, style이 행선택이면 포커스 컬럼은 유지하고, 컬럼 선택이면 포커스 행을 유지한다. 단일 선택 등 나머지 경우에는 index1 값에 가장 근접한 셀로 포커스를 설정한다. 

function setSelection (index1: CellIndex|Integer|GridColumn, index2: CellIndex|Integer|GridColumn, style: SelectionStyle, focus: Boolean): SelectionItem;
Returns
SelectionItem
Parameters
index1 - CellIndex|Integer|GridColumn. required.
선택 영역의 시작 위치.
Integer 값으로 행 위치만 지정하거나, GridColumn 객체로 컬럼 위치만 지정할 수 있다.v 1.3.8
index2 - CellIndex|Integer|GridColumn. required.
선택 영역의 끝 위치.
Integer 값으로 행 위치만 지정하거나, GridColumn 객체로 컬럼 위치만 지정할 수 있다.v 1.3.8
style - SelectionStyle.
지정하지 않으면 DisplayOptions.selectStyle을 따른다.
focus - Boolean.
true면 새로 추가되는 선택 영역에 맞게 포커스 위치를 변경한다. v 1.3.8
Code -1
    $('#select').click(funciton () {
        var idx1 = grdMain.focusedIndex();
        var idx2 = new DataLudi.CellIndex(grdMain.focusedRowIndex() + 10, idx1.column);
        grdMain.setSelection(idx1, idx2, DataLudi.SelectionStyle.BLOCK, true);
    }
Code -2
    $('#select').click(funciton () {
        grdMain.setSelection(3, 11, DataLudi.SelectionStyle.ROWS, true);
    }
See Also
CellIndex
SelectionStyle
DisplayOptions.selectStyle
Examples
Selection