SMART datagrid v1.4 > Classes > GridBase

Back  Forward

DataLudi.GridBase.onCurrentRowChanged  event

포커스 의 위치가 변경됐을 때 발생한다. 

행의 위치는 변경되지 않고 포커스 컬럼의 위치만 변경되는 경우 onCurrentChanged만 발생한다. 또, 변경되기 직전에 onCurrentChanging 이벤트가 발생한다. 

너무 빈번한 이벤트 발생이 문제가 되는 경우, DisplayOptionsrowChangeDelay 값을 지정하면 데이터행의 위치가 변경돼도 그 기간내에는 이 이벤트를 발생시키지 않는다. 

그리드에서 데이터행이 선택이 달라질 때 데이터행의 상세 정보를 다른 곳에 표시하는 등에 사용될 수 있다. 

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