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

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

问题描述

我正在加载一个完整的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填充了树状网格的展开"列.两种模式嵌套集模型的树状网格中都存在隐藏的列"expanded". 邻接模型.如果您在列中设置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天全站免登陆