AdvancedDataGrid ItemRenderer 被 HierarchicalData 忽略
我正在使用带有一些分层数据的 AdvancedDataGrid。在第一列中,我想通过将对象的“名称”属性的文本灰显来指示“名称”字段是否可编辑。这很奇怪,但是当我将 AdvancedDataGridColumn 的 dataField 属性设置为“name”并将其放在第一列中时,它似乎完全忽略了我的内联 ItemRenderer。如果我将 dataField 属性更改为其他属性,或者更改列顺序以使“名称”列不是第一个,那么一切都会突然正常。
任何有关此问题的帮助将不胜感激。让我知道是否还有更多代码会有帮助,但这是我尝试在第一列中使用的简单 ItemRenderer:
<mx:AdvancedDataGridColumn dataField="name" headerText="Name" width="150" editable="true" sortable="false">
<mx:itemRenderer>
<fx:Component>
<mx:Label color="{data.nameIsEditable ? 0x000000 : 0xCCCCCC}" />
</fx:Component>
</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
我的猜测是它与为第一列设置缩进或图标的方式有关有分层数据,但我真的不知道。提前致谢。
I am using an AdvancedDataGrid with some hierarchical data. In the first column, I want to indicate whether or not the "name" field is editable by graying out the text for the "name" property of my objects. It's very odd, but when I set the AdvancedDataGridColumn's dataField property to "name", and have it in the first column, it seems to completely ignore my inline ItemRenderer. If I change the dataField property to something else, or change the column ordering so the Name column isn't first, everything suddenly works.
Any help with this issue would be greatly appreciated. Let me know if any more code would help, but here is the simple ItemRenderer I'm trying to use in the first column:
<mx:AdvancedDataGridColumn dataField="name" headerText="Name" width="150" editable="true" sortable="false">
<mx:itemRenderer>
<fx:Component>
<mx:Label color="{data.nameIsEditable ? 0x000000 : 0xCCCCCC}" />
</fx:Component>
</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
My guess is that it has something to do with the way the indentation or icons can be set for the first column with hierarchical data, but I really have no clue. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要设置用于呈现
treeColumn
(显示图标的列,默认为第一列)的groupItemRenderer
。You need to set the
groupItemRenderer
which is used to render thetreeColumn
(the column that displays the icons, which per default is the first column).