Event |
Parameters |
Description |
afterInsertRow |
rowid |
This event fires after every inserted row. |
beforeProcessing |
data, status, xhr |
This event fire before proccesing the data from the server. Note that the data is formatted depended on the value of the datatype parameter - i.e if the datatype is 'json' for example thedata is JavaScript object |
beforeRequest |
none |
This event fire before requesting any data. Also does not fire if datatype is function. If the event return false the request is not made to the server |
beforeSelectRow |
rowid, e |
This event fire when the user click on the row, but before select them. |
gridComplete |
none |
This fires after all the data is loaded into the grid and all other processes are complete. Also the event fires independent from the datatype parameter and after sorting paging and etc. |
loadBeforeSend |
xhr, |
A pre-callback to modify the XMLHttpRequest object (xhr) before it is sent. Use this to set custom headers etc. Returning false will cancel the request. |
loadComplete |
data |
This event is executed immediately after every server request. |
loadError |
xhr, |
A function to be called if the request fails. The function gets passed three arguments: The XMLHttpRequest object (xhr), a string describing the type of error (status) that occurred and an optional exception object (error), if one occurred. |
onCellSelect |
rowid, |
Fires when we click on particular cell in the grid. |
ondblClickRow |
rowid, |
Raised immediately after row was double clicked. |
onHeaderClick |
gridstate |
Fire after clicking to hide or show grid (hidegrid:true); |
onPaging |
pgButton |
This event fires after click on [page button] and before populating the data. Also works when the user enters a new page number in the page input box (and presses [Enter]) and when the number of requested records is changed via the select box. To this event we pass only one parameter pgButton See pager. |
onRightClickRow |
rowid, |
Raised immediately after row was right clicked. |
onSelectAll |
aRowids, |
This event fires when multiselect option is true and you click on the header checkbox. |
onSelectRow |
rowid, |
Raised immediately after row was clicked. |
onSortCol |
index, |
Raised immediately after sortable column was clicked and before sorting the data. |
resizeStart |
event, index |
Event which is called when we start resize a column. event is the event object, index is the index of the column in colModel. |
resizeStop |
newwidth, index |
Event which is called after the column is resized. newwidth is the is the new width of the column , index is the index of the column in colModel. |
serializeGridData |
postData |
If set this event can serialize the data passed to the ajax request. The function should return the serialized data. This event can be used when a custom data should be passed to the server - e.g - JSON string, XML string and etc. |
调用ajax的事件顺序如下:
1.beforeRequest
2.loadBeforeSend
3.serializeGridData
4.loadError (if a error from the request occur - the event from steps 5 till 7 do not execute. If there is no error the event 4. does not execute and we continue to with the step 5.)
5.beforeProcessing
6.gridComplete
7.loadComplete
本文转自cnn23711151CTO博客,原文链接:http://blog.51cto.com/cnn237111/782124 ,如需转载请自行联系原作者