jqGrid TreeGrid loadonce等问题
我正在使用 jqGrid 3.7.2 并且正在渲染树形网格。网格渲染得很好,但我有两个主要问题。
loadonce=true 似乎不起作用。当我展开节点时,它会尝试从服务器加载数据,即使我已经向网格提供了所有数据。这导致了我的第二个问题...
我无法折叠节点。图标发生变化,就像折叠一样,但我可以看到它的所有子项。我尝试过非常简单的数据样本,但无法让任何东西正常工作。这是我配置网格的方式......
(所以由于某种原因不会发布 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.
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...
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我验证了子行也没有发布在树状网格的版本 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.
我遇到了这个问题。我最终省略了 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.