Events

Many of the following events use the parameters defined here:

Event Parameters Description
afterEditCell rowid, cellname, value, iRow, iCol applies only to a cell that is editable; this event fires after the cell is edited.
afterSaveCell rowid, cellname, value, iRow, iCol applies only to a cell that is editable; this event fires after the cell has been successfully saved. This is the ideal place to change other content.
afterSubmitCell serverresponse, rowid, cellname, value, iRow, iCol applies only to a cell that is editable; this event Fires after the cell and other data is posted to the server Should return array of type [success(boolean),message] when return [true,""] all is ok and the cellcontent is saved [false,"Error message"] then a dialog appears with the "Error message" and the cell content is not saved. servereresponse is the response from the server. To use this we should use serverresponse.responseText to obtain the text message from the server.
beforeEditCell rowid, cellname, value, iRow, iCol applies only to a cell that is editable; this event fires before editing the cell.
beforeSaveCell rowid, cellname, value, iRow, iCol applies only to a cell that is editable; this event fires before validation of values if any. This event can return the new value which value can replace the edited one
beforeSaveCell : function(rowid,celname,value,iRow,iCol) { if( some_condition ) { return "new value"; } }
The value will be replaced with "new value"
beforeSubmitCell rowid, cellname, value ,iRow, iCol applies only to a cell that is editable; this event fires before submit the cell content to the server (valid only if cellsubmit : 'remote'). Can return new array that will be posted to the server.
beforeSubmitCell : function(rowid,celname,value,iRow,iCol) { if( some_condition ) { return {name1:value1,name2:value2} } else { return {} } }
The returned array will be added to the cellurl posted data.
errorCell serverresponse, status fires if there is a server error; servereresponse is the response from the server. To use this we should apply serverresponse.responseText to obtain the text message from the server. status is the status of the error. If not set a modal dialog apper.
formatCell rowid, cellname, value, iRow, iCol applies only to a cell that is editable; this event allows formatting the cell content before editing, and returns the formatted value
onSelectCell rowid, celname, value, iRow, iCol applies only to cells that are not editable; fires after the cell is selected


  Last Updated: 2/8/2009 | © Tony's jqGrid - a jQuery Plugin, 2010