如何知道是否有在的AdvancedDataGrid子项/节点 [英] How to know if there are sub items/nodes in an AdvancedDatagrid

查看:147
本文介绍了如何知道是否有在的AdvancedDataGrid子项/节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要总结:如何删除一个节点分支(1级),如果它具有零数据项?而反过来也是在更高层次0删除节点,如果它的子项(空或已经)去掉?

在很多搜索互联网我还需要知道如何找出如果一个的AdvancedDataGrid

After much searching on the internet I still need to know if how to find out if an AdvancedDatagrid or a "node" contains children. How to know if it's empty or has "something"? With it, I will be able to filter it with my function.. (Expalined below):

首先,我对我的英语不好表示歉意。

Firstly I apologize for my bad english.

我有一个的AdvancedDataGrid 的dataProvider 的ArrayCollection 。 我在节点使用 GroupingCollection2 来组我的数据。

I have an AdvancedDatagrid with for dataProvider an ArrayCollection. I use a GroupingCollection2 to group my data in nodes.

我用一个的ICollectionView 的dataProvider 的的的AdvancedDataGrid 。它的工作原理!

I use a filterFunction on a ICollectionView of dataProvider of the AdvancedDatagrid. It works!

我的分组数据的例子:

- Node level 0
  -- Node level 1
     ++ Data 1
     ++ Data 2
     ++ Data 3
  -- Node level 1
     ++ Data 4
     ++ Data 5
- Node level 0
  -- Node level 1
     ++ Data 6
     ++ etc..

我只过滤这些都对叶子(数据子节点)的数据。经过我的过滤功能,数据项正确过滤!

I filter only the data which are on "leafs" (Data sub nodes). After my filter function, Data items are correctly filtered!

例如:数据2 数据4 数据5 数据6

- Node level 0
  -- Node level 1
     ++ Data 1
     ++ Data 3
  -- Node level 1

- Node level 0
  -- Node level 1

对于例如节点不必要的数据正确过滤掉。

但我想也过滤掉那些现在空节点!那是说的如何删除一个节点分支(1级),如果它具有零叶的项目?而反过来,如果它的总支行为零,他们已经删除后还可以删除一个节点级别0?

BUT I want to filter out those now "empty" nodes too!! Thats is to say How can I remove a node branch (level 1) if it has zero leaf items? And in turn also remove a Node level 0 if it's total sub-branches are zero after they've been removed?

我想这个名单:

- Node level 0
  -- Node level 1
     ++ Data 1
     ++ Data 3

感谢你在前进。

(PS:我可以的问题,如果我是不够具体)

(ps: i'm available for questions if I was not enough specific)

推荐答案

嗯,我想通了最后!

我的秘密是,当与 GroupingCollection2 I组数据我传递到分组节点的一些消息的(用的GroupingField 的。但消息没有显示由节点的的itemRenderer。 并与的系统上,这些消息我使用他们在我的 filterFucntion

My secret is when I group data with GroupingCollection2 I pass to the node grouped some news (with a groupingField). But news are not showed by the itemRenderer of the node. And with a system of substring on these news I use them in my filterFucntion.

关于基本分组和我的分组之间的差异说明: 在当你组数据,创建的节点只包含其中,他们已经创造了该领域的事实。

Explanations about difference between "basic" grouping and my grouping : In fact when you group data, created nodes contain only the field whereby they've been created.

例如我的数据有4个fiels:域名,测试,状态,版本。 我将它们分组按域和放大器;通过测试这样的(它是如何我的数据显示,一例子,有一个项目渲染器为每个级别不同)的。

For instance my data have 4 fiels : domain, test, status, version. I group them by domain & by test like this (it's a example of how my data are showed, with an item renderer different for each level).

之前的数据像这样:

- domain 1
  -- test 1
     ++ status/version 1
     ++ status/version 2
  -- test 2
     ++ status/version 3
     ++ status/version 4
- domain 2 etc..

但是上的叶子(++行),分组后,有尚领域分组的数据。即测试和域场!

But on the leafs (++ rows), after grouping, there is yet data of the fields "grouped". Namely test and domain field!

对于基本的分组后总结:

  • 在节点级别0数据:域
  • 在节点级别1的数据:测试
  • 在叶级数据2:域名/测试/状态/版本

之后我的分组数据显示是一样的。

我的分组之后:

  • 在节点级别0数据:域
  • 在节点级数据1:域/测试
  • 在叶级数据2:域名/测试/状态/版本

感谢,我可以用我的过滤功能(使用子系统)知道每个节点,并通过在同一场合的父母,如果该节点的过滤后是空的!

Thanks to that I can with my filter function (using substring system) know the parent of each node and by the same occasion if the node is empty after a filter!

我觉得我不太清楚在所有和我道歉......这真的很复杂,所以我很愿意回答更具体的问题,如果有人遇到类似的问题!!

这篇关于如何知道是否有在的AdvancedDataGrid子项/节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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