开发者

jqGrid TreeGrid loadonce and other issues

I'm using jqGrid 3.7.2 and I'm rendering a treegrid. The grid renders just fine however I have 2 major issues.

  1. loadonce=true doesn't seem to be working. When I expand a node, it tries to load the data from the server even though I've already supplied all the data to the grid. And that leads to my second issues...

  2. I can't collapse nodes. The icon changes as if it is collapsed but I can see all it's children. I've tried very simplistic data samples and can't get anything to work right. Here is how I have my grid configured....

(SO won't post JavaScript code for some reason) http://gist.github.com/522085

Generally, I'm returning JSON but I've also tried the same data sample using XML and get the same results. Rendered tree but won't allow me to collapse nodes.

 <rows>
    <page>1</page>
    <total>1</total>
    <records>1</records>
    <row>
     开发者_Go百科 <cell>1</cell>
      <cell>Gregg</cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell>0</cell>
      <cell>1</cell>
      <cell>2</cell>
      <cell>false</cell>
      <cell>true</cell>
  </row>
  <row>
      <cell>2</cell>
      <cell>Bolinger</cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell></cell>
      <cell>1</cell>
      <cell>1</cell>
      <cell></cell>
      <cell>true</cell>
      <cell>false</cell>
  </row>
</rows>

Any help would be much appreciated.


I verified that child rows are not posted in version 4 of treegrid also and posted question about it in

https://stackoverflow.com/questions/5916468/jqgrid-treegrid-does-not-collapse-leaf-nodes-on-click

In samples child rows are collapsed so there should be something simple missing. Try to remove child rows on root node click.


I had this exact problem. I ended up omitting the 'expanded' and 'loaded' parameters from the JSON, and then collapsing functionality was fixed. However, the "Loading..." text still shows up even though the data is local.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜