jqGrid TreeGrid loadonce等问题

发布于 2024-09-13 19:25:37 字数 1627 浏览 2 评论 0原文

我正在使用 jqGrid 3.7.2 并且正在渲染树形网格。网格渲染得很好,但我有两个主要问题。

  1. loadonce=true 似乎不起作用。当我展开节点时,它会尝试从服务器加载数据,即使我已经向网格提供了所有数据。这导致了我的第二个问题...

  2. 我无法折叠节点。图标发生变化,就像折叠一样,但我可以看到它的所有子项。我尝试过非常简单的数据样本,但无法让任何东西正常工作。这是我配置网格的方式......

(所以由于某种原因不会发布 JavaScript 代码) http://gist.github.com/522085

一般来说,我返回 JSON 但我已经还尝试使用 XML 进行相同的数据样本并获得相同的结果。渲染树但不允许我折叠节点。

 <rows>
    <page>1</page>
    <total>1</total>
    <records>1</records>
    <row>
      <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>

任何帮助将不胜感激。

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>
      <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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

筑梦 2024-09-20 19:25:37

我验证了子行也没有发布在树状网格的版本 4 中,并在

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

在示例中,子行被折叠,因此应该有一些东西简单的失踪。尝试删除根节点单击上的子行。

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.

转角预定愛 2024-09-20 19:25:37

我遇到了这个问题。我最终省略了 JSON 中的“展开”和“加载”参数,然后修复了折叠功能。然而,即使数据是本地的,“正在加载...”文本仍然显示。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文