English 中文(简体)
a. 动态扩大子电网
原标题:Dynamically Expand Subgrid in a loop - JQGrid

我已经用一个子电网,使用次电网。

And I want to dynamically expand some rows of the grid so I wrote following in GridComplete Event of First Grid. ids is array of row ids of my Grid

for(int i =0; i< ids.length; i++) {
    //Checking with condition
    $("#myGridName").expandSubGridRow(ids[i]);
}

我也尝试采用以下代码,但出于某种原因,GridComplete的检查箱只为最后一次扩大的浏览添加。

$("#myGridName").expandSubGridRow(ids[0]);
$("#myGridName").expandSubGridRow(ids[1]);

高于法典,可扩大适当的增长。 但是,

在次电网的GrudComplete活动中,我在每个行子里都安装了检查箱。

因此,我需要检查一些切克盒。

但问题是,

The subgrid_row_id is Hawaii

i.e. 扩大的最后一个子电网的ID被分配到父母GridRow Expanded。

说明:我用人工方式在子电网各行之间添加检查箱

预付款。

问题回答

如果我理解你的话,你会纠正你在上所讨论的问题。 页: 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" 答案对你有用。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.