jqgrid loadComplete
时间: 2024-01-03 12:04:00 浏览: 117
JQueryComplete
"jqgrid loadComplete" is an event that is triggered after the data has been loaded into a jqGrid, and the grid has been populated with rows. This event can be used to perform additional processing or manipulation of the data, or to customize the appearance or behavior of the grid.
Here is an example of how you might use the "jqgrid loadComplete" event to customize the appearance of a jqGrid:
```javascript
$("#myGrid").jqGrid({
url: "data.php",
datatype: "json",
colModel: [
{ name: "id", label: "ID", width: 50 },
{ name: "name", label: "Name", width: 200 },
{ name: "age", label: "Age", width: 50 },
// other columns...
],
loadComplete: function(data) {
// Set the background color of even-numbered rows to light gray
$("#myGrid tr:even").css("background-color", "#f9f9f9");
}
});
```
In this example, the "loadComplete" event is used to set the background color of even-numbered rows to light gray. The event handler function is passed a "data" parameter that contains the loaded data, which can be used to perform additional processing or manipulation of the data if needed.
The "loadComplete" event can be useful for customizing the appearance or behavior of a jqGrid based on the loaded data, or for performing additional processing or manipulation of the data before it is displayed in the grid.
阅读全文