更改 AdvancedDataGrid 中的组标签
我正在尝试使用 AdvancedDataGrid 来显示一些分组数据。通常,flex 将其显示在“树视图”中,并带有代表该组的文件夹图标。我需要根据对象中的整数 ID 字段对数据进行分组,但我希望文件夹图标的标签显示对象中的 groupName 字段。
这是一个小例子:
{groupName: group1, ID: 1234}
{groupName: group2, ID: 5678}
<mx:grouping>
<mx:Grouping label="Group"> <--- The label of the whole column
<mx:GroupingField name="ID">
</mx:Grouping>
</mx:grouping>
结果输出:
=== Group ===
+ 1234
- child
- child
+ 5678
...
但我真的很想输出:
=== Group ===
+ group1
- child
- child
+ group2
...
如果有人有任何提示,我将不胜感激。
——丹
I'm trying to use an AdvancedDataGrid to display some grouped data. Normally flex displays this in a "tree view" with a folder icon represent the group. I need to group the data based on an integer ID field in my object, but I'd like the label for the folder icon to display the groupName field in my object.
Here's a little example:
{groupName: group1, ID: 1234}
{groupName: group2, ID: 5678}
<mx:grouping>
<mx:Grouping label="Group"> <--- The label of the whole column
<mx:GroupingField name="ID">
</mx:Grouping>
</mx:grouping>
Resulting output:
=== Group ===
+ 1234
- child
- child
+ 5678
...
But I'd really like to output:
=== Group ===
+ group1
- child
- child
+ group2
...
If anyone has any tips I'd appreciate it.
-- Dan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 GroupingField#groupingFunction。来自 adobe 文档:
Have a look at GroupingField#groupingFunction. From the adobe docs: