简体   繁体   English

Flex 4.5:自定义组件在自定义 ItemRenderer 中不可见

[英]Flex 4.5: Custom component doesn't get visible in custom ItemRenderer

I'm developing a dynamic ItemRenderer to edition in line for Spark DataGrid.我正在为 Spark DataGrid 开发一个动态的 ItemRenderer 版本。

With the Click event on Edit button (first column), I'm refreshing the cell's row using grid.invalidateCell(x,y);通过编辑按钮(第一列)上的 Click 事件,我使用 grid.invalidateCell(x,y); 刷新单元格的行; inside this custom ItemRenderer, in the function prepare , I'm evaluating an 'editing' dynamic property to hide/show (.visible/.includeInLayout) the default Label or Control for edition;在此自定义 ItemRenderer 中,在 function prepare中,我正在评估“编辑”动态属性以隐藏/显示(.visible/.includeInLayout)默认的 Label 或版本控制; I'm not using actually the itemEditor DataGrid's operation, just simulating this functionality.我实际上并没有使用 itemEditor DataGrid 的操作,只是模拟这个功能。

Everything goes well with standard spark components for edition: TextInput, ComboBox, etc, but custom components (extended from SkinnableContainer) doesn't get visible, just randomically on first row sometimes.标准 spark 组件一切顺利:TextInput、ComboBox 等,但自定义组件(从 SkinnableContainer 扩展)不可见,有时只是随机出现在第一行。

Is there any specific interface that custom components must implement to work inside an ItemRenderer??自定义组件是否必须实现任何特定接口才能在 ItemRenderer 中工作?

The problem was this property: customComponent.includeInLayout;问题是这个属性:customComponent.includeInLayout; once you set it to false, it has problems to get visible again.一旦将其设置为 false,它就很难再次可见。 I think it's bad idea to use includeInLayout inside an ItemRenderer.我认为在 ItemRenderer 中使用 includeInLayout 是个坏主意。

Now I'm working only with.visible=(false/true) and.x coordinate.现在我只使用 .visible=(false/true) 和 .x 坐标。

Thanks.谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM