SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.onCurrentRowChanged  event

It will be fired when the location of focused Row is changed. 

If only the location of focused column is changed rather than the location of row, onCurrentChanged will be fired only. And, onCurrentChanging event will be fired just before the change. 

When too many frequent events can be a problem, if specify rowChangeDelay value of DisplayOptions, even if the location of data row is changed, this event will not be fired during the corresponding period. 

It can be used to display the details of data row in another place when the selection of data row is changed in grid. 

function onCurrentRowChanged (grid: GridBase, newRow: Integer, oldRow: Integer);
Returns
Void
Parameters
grid - GridBase.
newRow - Integer.
oldRow - Integer.
Code -1
    grid.onCurrentRowChanged = function (grid, newRow, oldRow) {
        if (newRow >= 0) {
            $('#name').val(ds.getValue(newRow, 'fldName'));
            $('#salary').val(ds.getValue(newRow, 'fldSalary'));
        } else {
            $('#name').val('');
            $('#salary').val('');
        }
    };
See Also
onCurrentChanged
onCurrentChanging
focusedIndex
CellIndex
Examples
Focused Cell