问题标签 [treegrid]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1216 浏览

datagrid - Dojo datagrid and treegrid help - datagrid has a reformating flash?

I'm having a bit of a time trying to get Dojo grids (1.5) to play nice. Specifically I've spent about two weeks of work trying to implement a grid that allows for our result set data to collapse into rows, where rows can be expanded. Data comes in as a full set in JSON format, using ItemFileReadStore as the store. Any subsequent sorts or pagings are handled by GETing a new json from the application, and passing in new query parameters in the url.

The nested data was only two layers deep - a top layer to always be displayed and an array of child data with identical structure as the top layer. Each node has a unique ID and a cluster ID - on a parent node the unique ID and cluster ID will match.

I was initially very excited with TreeGrid - but I couldn't see how I could format it to do what I needed - namely eliminate the 'summary row' and one extra row full of null cells (???) that I just couldnt figure out how to remove unless I focused the query to only one cluster. I studied the test examples, built many test pages myself, tried to understand the forestModel, which for what I could tell was unnecessary... I found so little documentation, and sources I found online hinted that TreeGrid might not be reliable...

So I decided I would try to implement the expandable/collapsible rows in dataGrid.

I flattened the JSON data and added another attribute to indicate being a top level node ('alwaysShow' = true). I built my grid programaticaly and applied grid.filter() to pull only those top level nodes. I modified that filter by extending the ItemFileReadStore _FetchItems "filter" method to allow for OR querying instead of AND, and also modified it to allow for keys to point to arrays - when a top level node (small +/- icon in the cell) is clicked, the cluster ID of the parent node is added to the grid.filter.allowed[] and the filter is updated, allowing nodes with that cluster_id value to be displayed.

This worked fine on my small test set of five records (although id say a little slugish...) - but now I am pulling ~900 rows back from the application, and on expanding large clusters (~80 rows) I am seeing a very long flash of blue and white on the filter updates. I've spent most of my day trying to step through in firebug to find where its happening, but the dojo logic is so spread out. Seems to be happening before the call to _Grid.js defaultUpdate.

Its so bad that I am considering trying again with TreeGrid. Im also considering just doing this by hand... Im kicking myself for spending so much time trying to get Dojo to work to begin with. I would also consider a commercial "JSON->table with collapsible row" library if anyone has any recommendations...

Any suggestions or insights? Familiarity with the flashing problem or how I could adapt TreeGrid to my needs? I'm aware this is a bit of a rant... Many thanks for any help.
-robbie

EDIT: I eventually gave up trying to get Dojo to do what I needed and coded it myself in less than a day. Not the best use of three weeks...

0 投票
1 回答
596 浏览

jqgrid - 我可以设置一个 jqgrid treegrid 以便它在打开的行上获取子数据吗?如何?

示例 treegrid 实现并不完全清晰。我有一个像这样的网格:

我从 json 对象填充。当您单击 时+,我想转到服务器并获取与该行的 id 关联的数据:

有没有更清楚地表明这一点的例子?此外,我看到的那些似乎希望您一次性获取整个数据集。还是“添加”和“减去”行是解决这种情况的更好方法?

更新:再想一想,我不认为加/减方法会很好,因为它会破坏排序。

0 投票
4 回答
4147 浏览

jqgrid - 带有寻呼机的 jqGrid 树网格

我们如何使用 jqGrid 使用寻呼机制作树形网格?

我已经检查并尝试了演示,但它没有显示任何寻呼机,即使代码中有一个寻呼机 div

如何创建寻呼机?

0 投票
1 回答
708 浏览

javascript - 从 CoqSoft 扩展和维护 TreeGrid 小部件

任何人都有使用他们的 API 从 CoqSoft 扩展 TreeGrid 功能的经验?我正在寻找一个好的 Javascript 数据网格框架来实现自定义排序、过滤、分组和 Excel 数据透视表等功能。TreeGrid 似乎提供了很多这些功能,但不确定维护代码是否容易。谢谢。

0 投票
1 回答
615 浏览

dojo - dojo treegrid有等级限制吗?

在过去的几天里,我试图让 treegrid 使用 Forestmodel 工作。在我看来,使用以编程方式创建的树形网格可以显示的级别数量是有限制的。我修改了 dojo 的“dojox/grid/tests/test_treegrid_model2.html”,一旦我在“Ottwa”下添加另一个级别,我得到一个“dojo.data.ItemFileReadStore:无效的项目参数”。错误。

... { id:'CA',名称:'Canada',类型:'country',人口:'3300 万',面积:'9,984,670 平方公里',儿童:[{_reference:'Ottawa'},{_reference :'Toronto'}]}, { id: 'Ottawa', name:'Ottawa', type:'city', 人口:'90万', timezone:'-5 UTC', children:[{_reference:'Ottawa1 '}]},{ id:'Ottawa1',名称:'Ottawa1',类型:'city1',人口:'90 万',时区:'-5 UTC'},...

如果我将 2 个新城市添加到加拿大,它就可以了。... { id:'CA',名称:'Canada',类型:'country',人口:'3300 万',面积:'9,984,670 平方公里',儿童:[{_reference:'Ottawa'},{_reference :'Toronto'}, {_reference:'Ottawa1'}, {_reference:'Ottawa2'}] }, { id: 'Ottawa', name:'Ottawa', type:'city', 人口:'90万',时区:'-5 UTC'},{ id:'Ottawa1',名称:'Ottawa1',类型:'city1',人口:'90 万',时区:'-5 UTC'},{ id:'Ottawa2' ,名称:'Ottawa2',类型:'city1',人口:'90万',时区:'-5 UTC'},...

TreeGrid 中可以显示的级别数量是否有限制?谢谢,

大卫

0 投票
0 回答
207 浏览

javascript - 重新排序 smartclient 的 TreeGrid 后是否有事件?

我正在使用同构智能客户端。

我有一个具有拖放功能的 DataBound TreeGird。如果我重新排序我的节点,更改将发送到服务器。

服务器响应后,我必须在哪里做某事?如果重新排序没问题,我必须刷新一些其他视图。

谢谢

0 投票
1 回答
2334 浏览

tree - Smartgwt 从代码中选择树节点

我有一个TreeGrid,我有一个Tree

并且我希望每次向树中添加一个节点以专注于它。

更一般地说,我怎样才能从代码中选择TreeNodea Tree

我知道这是navTreeGrid.getSelectedRecord()方法,但不是我想要的。

谢谢!

0 投票
2 回答
1826 浏览

extjs - 如何根据另一个单元格中的值格式化 ExtJS treegrid 单元格

我正在尝试根据同一行中另一个单元格中的值格式化一个 ExtJS treegrid 单元格。下面是我目前如何对其进行编码的概述。但是,这目前不起作用,因此我将不胜感激任何建议。谢谢!

0 投票
1 回答
1583 浏览

extjs - 如何格式化 ExtJS treegrid 边框

所以我认为在 extjs treegrid 中格式化边框是基本的,但经过数小时的尝试和环顾四周后,我无法找到解决方案。我遇到的问题是我的边框外观和宽度在列和行之间不一致(尝试附加屏幕截图,但自从新站点以来就不能)。我尝试直接在列创建中定义边框:

以及在我设置单元格背景颜色的 XTemplate 中(不认为这会起作用,但我想我会尝试):

有谁知道如何格式化treegrid边框来解决这个问题?

谢谢。

0 投票
1 回答
24070 浏览

jqgrid - Jqgrid 树视图邻接

我在 ma 应用程序中使用 Jqgrid 树视图模型,我可以看到它显示错误,因为不支持对象或属性我已包含 grid.Treeview.js 和其他 Jqgrid 脚本文件。我不知道可能是什么问题。当我在网络中检查示例应用程序的邻接树视图时,我尝试了同样的事情,但在 asp.net 中使用了我没有得到的本地数据。任何人都可以帮助我如何做同样的事情。提前致谢

这是我使用的示例代码,而且我不知道它是否会工作。