RealGrid2 Guide
Events
Order of event occurrence

Event occurrence order

This is a page that collects various events related to add/edit/delete, copy/paste, and move.

Applied add/edit/delete events

gridView.onCopy = function(grid, selection, event) {
     addLog("grid.onCopy");
};
 
gridView.onCurrentChanging = function (grid, oldIndex, newIndex) {
     addLog("grid.onCurrentChanging: " + "(" + oldIndex.itemIndex + ", " + oldIndex.column + ") => (" + newIndex.itemIndex + ", " + newIndex.column + ")");
 
     // return false; If you do this, the location does not change.
};
 
gridView.onCurrentChanged = function (grid, newIndex) {
     addLog("grid.onCurrentChanged: " + "(" + newIndex.itemIndex + ", " + newIndex.column + ")");
};
 
gridView.onCurrentRowChanged = function (grid, oldRow, newRow) {
     addLog("grid.onCurrentRowChanged: " + "(" + oldRow + " => " + newRow + ")");
};
 
gridView.onEditCanceled = function (grid, index) {
     addLog("grid.onEditCanceled driven, edit index=" + JSON.stringify(index));
};
 
gridView.onEditChange = function (grid, index, value) {
     addLog("grid.onEditChange driven, " + index.column + ' at ' + index.dataRow + ' was replaced by value: ' + value);
};
 
gridView.onEditCommit = function (grid, index, oldValue, newValue) {
     addLog("grid.onEditCommit driven, " + oldValue + " => " + newValue);
};
 
gridView.onEditRowChanged = function (grid, itemIndex, dataRow, field, oldValue, newValue) {
     var v = grid.getValue(itemIndex, field);
     addLog("grid.onEditRowChanged: " + oldValue + " => " + newValue);
};
 
gridView.onGetEditValue = function (grid, index, editResult) {
     addLog("grid.onGetEditValue: " + JSON.stringify(editResult));
};
 
gridView.onCellEdited = function (grid, itemIndex, row, field) {
     addLog("grid.onCellEdited: " + itemIndex + ', ' + field);
}
 
gridView.onHideEditor = function (grid, index) {
     addLog("grid.onHideEditor: " + index.itemIndex + "," + index.column);
};
 
gridView.onItemEditCancel = function (grid, itemIndex, state) {
     addLog("grid.onItemEditCancel: " + state);
    
     //return false; If you do so, it will not be cancelled.
};
    
gridView.onItemEditCanceled = function (grid, itemIndex, state) {
     addLog("grid.onItemEditCanceled: " + state);
};
 
gridView.onPaste = function (grid, index, event){
     addLog("grid.Paste");
};
 
gridView.onPasted = function (grid){
     addLog("grid.Pasted");
}
 
gridView.onEditRowPasted = function (grid, itemIndex, row, fields, oldValues, newValues) {
     addLog('grid.onEditRowPasted: {' + newValues.join() + '}');
};
 
gridView.onRowInserting = function (grid, itemIndex, dataRow) {
     addLog("grid.onRowInserting: " + itemIndex);
 
     //To prevent addition, return a string message or boolean false.
     return null;
};
 
gridView.onRowsDeleting = function (grid, rows) {
     addLog("grid.onRowsDeleting: " + rows);
 
     //If a non-null value is returned, the specified text is displayed and deletion is canceled.
     return null;
};
 
gridView.onRowsPasted = function (grid, items) {
     addLog("grid.onRowsPasted" + items);
};
 
gridView.onShowEditor = function (grid, index, props, attrs) {
     addLog("grid.onShowEditor: " + index.itemIndex + "," + index.column);
};
 
dataProvider.onDataChanged = function (provider) {
     addLog("provider.onDataChanged");
};
 
dataProvider.onRestoreRows = function (provider, rows) {
     addLog('provider.onRestoreRows: ' + rows.join(', '));
};
 
dataProvider.onRowCountChanged = function (provider, newCount) {
     addLog("provider.onRowCountChanged: " + newCount);
};
 
dataProvider.onRowDeleted = function (provider, row) {
     addLog('provider.onRowDeleted: ' + row);
};
 
dataProvider.onRowDeleting = function (provider, row) {
     addLog('provider.onRowDeleting: ' + row);
     return true;
};
 
dataProvider.onRowInserted = function (provider, row) {
     addLog("provider.onRowInserted");
};
 
dataProvider.onRowInserting = function (provider, row, values) {
     addLog('provider.onRowInserting: ' + row);
     return true;
};
 
dataProvider.onRowListUpdated = function (provider, rows) {
     addLog("provider.onRowListUpdated: " + rows.join(', '));
};
 
dataProvider.onRowMoved = function (provider, row) {
     addLog("provider.onRowMoved: " + row + ' to ' + newRow);
};
 
dataProvider.onRowMoving = function (provider, row, newRow) {
     addLog("provider.onRowMoving: " + row + ' to ' + newRow);
 
     return true;
};
 
dataProvider.onRowsDeleted = function (provider, rows) {
     addLog("provider.onRowsDeleted: " + rows.join(', '));
};
 
dataProvider.onRowsInserted = function (provider, row, count) {
     addLog("provider.onRowsInserted: " + count + " rows inserted!");
};
 
dataProvider.onRowsMoved = function (provider, row, count, newRow) {
     addLog('provider.onRowsMoved: ' + count + ' rows moved');
};
 
dataProvider.onRowStateChanged = function (provider, row) {
     addLog('provider.onRowStateChanged: ' + row);
};
 
dataProvider.onRowStatesChanged = function (provider, rows) {
     addLog('provider.onRowStatesChanged: ' + rows.join(','));
};
 
dataProvider.onRowStatesCleared = function (provider) {
     addLog('provider.onRowStatesCleared');
};
 
dataProvider.onRowsUpdated = function (provider, row, count) {
     addLog('provider.onRowsUpdated');
};
 
dataProvider.onRowUpdated = function (provider, row) {
     addLog("provider.onRowUpdated: " + row);
};
 
dataProvider.onRowUpdating = function (provider, row) {
     addLog("provider.onRowUpdating: " + row);
     return true;
};
 
dataProvider.onValueChanged = function (provider, row, field) {
     addLog('provider.onValueChanged: ' + row + ' row, ' + field + ' fieldIndex');
};

For levels, messages, error states, etc., see Cell Validation.