SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.getCellIndex  method

创建和返回具有通过参数rowIndexcolumn而指定的位置值的CellIndex对象。 

如果不指定rowIndex,就会使用0,而如果不指定column,则会使用第一列。 如果将column指定为字符串,就会寻找具有相关值为其名的列对象。 

function getCellIndex (rowIndex: Integer|GridRow, column: GridColumn): CellIndex;
Returns
CellIndex
Parameters
rowIndex - Integer|GridRow.
column - GridColumn.
Code -1
    var index = grid.getCellIndex(2, grid.columnByField('order_id'));
    // 或,通过列名称
    var index = grid.getCellIndex(2, 'colOrder');
    
    grid.setFocusedIndex(index);
See Also
focusedIndex
focusedRow
focusedColumn
setFocusedIndex
setFocusedRow
getFirstColumn
CellIndex
Examples
聚焦单元格