如果我理解你的话,你会纠正你在上所讨论的问题。 页: 1 http://www.trirand.com/jqgridwiki/doku.php?id=wiki:subgrid#properties”rel=“nofollow noreferer”>expandOnLoad: real property of thecode>subGridOptions . 同我在。 回答: jqGrid不支持Ajax要求。 如果是,
$("#myGridName").expandSubGridRow(ids[0]);
Ajax申请将发给服务器。 我们从服务器收到内部财产的相应答复。
$("#myGridName")[0].grid.hDiv.loading
定在<代码>true和所有其他Ajax要求,例如从$(>#myGridName”)上。
The same problem (bug) exist in the current implementation of expandOnLoad: true
. If you open in the official jqGrid demo the "Hierarchy (4.0) new" tree node and then look at the demo "Expand all Rows on load" you will see that not all rows are correctly expanded as promised (you have to scroll the grid to see all subgrids).
我认为,为了准确地扩大装货网,你应当就以下事项采取行动:
- You should examine the list of collapsed subgrids (the corresponding row has class "sgcollapsed") and expand only the first found subgrid.
- The expanding of the next subgrid should be done only after the response from the server will be received and processed.
I can recommend you to use success
callback function of ajaxSubgridOptions
jqGrid options because there are no loadComplete
event after loading the subgrid. The current implementation of the Ajax request in subgrid uses complete
callback function of jQuery.ajax (see here) which will be called before success
callback. So you can define your success
callback as the method of the ajaxSubgridOptions
option of jqGrid. Inside of the success
callback you can call $("#myGridName").expandSubGridRow(ids[i])
for the next node (if any still not expanded). In the way you can open all subgrids.
https://stackoverflow.com/questions/7080859/jqgrid-iterate-over-the-grid-data-in-a-subgrid/7084920#7084920" 答案对你有用。