在 jqgrid treegrid 中,我如何指定我希望数据默认折叠(即使所有数据都已加载) [英] in jqgrid treegrid, how can i specify that i want the data collapsed by default (even though all data is loaded)

查看:21
本文介绍了在 jqgrid treegrid 中,我如何指定我希望数据默认折叠(即使所有数据都已加载)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在加载一个完整的树形网格,但我想让它折叠以仅显示级别 1(而不是显示所有展开的内容)

I am loading a full treegrid but i would like to have it collapse to only show level 1 (versus showing everything expanded)

当我的 jqgrid treegrid 加载和重新加载时,是否可以指定初始视图(折叠或展开)

is there anyway to specify initial view (collapsed or expanded) when my jqgrid treegrid loads and reloads

再次,我确实想将所有内容加载到客户端,但只是将折叠的内容显示为初始视图.

again, i DO want to load everything to the client, but just show things collapsed as the inital view.

我在 主文档页面上看不到任何选项

推荐答案

问题中既没有包含 jqGrid 定义,也没有包含用于填充三个网格的测试 JSON 或 XML 数据.我想,您用 true 填充了树形网格的扩展"列.两种模式 嵌套集模型的树网格中都存在隐藏列扩展"邻接模型.如果您在列中设置 false,则不会扩展树.请参阅此处示例.

You don't included in the question neither jqGrid definition nor the test JSON or XML data which you use to fill the three grid. I suppose, that you filled the 'expanded' column of the tree grid with true. The hidden column 'expanded' exist in the tree grid for both mode Nested Set Model and Adjacency Model. If you would set false in the column the tree will be not expended. See here an example.

您应该查看 AdjacencyTree 的倒数第二列.json.它包含 false,因此不会展开任何树节点.JSON文件中隐藏列的包含如下

You should take a look in the next-to-last column of the AdjacencyTree.json. It contains false, so no tree node will be expanded. The contain of the hidden columns from the JSON file are the following

level parent isLeaf expanded loaded
-----------------------------------
  0          false    false   true
  1     1    false    false   true
  2     2     true    false   true
  2     2    false    false   true
  3     4     true    false   true
  2     2     true    false   true
  1     1    false    false   true
  2     7    false    false   true
  3     8     true    false   true
  3     8     true    false   true
  2     7     true    false   true

这篇关于在 jqgrid treegrid 中,我如何指定我希望数据默认折叠(即使所有数据都已加载)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆