简体   繁体   English

Flex 4 ItemRenderer问题

[英]Flex 4 ItemRenderer Question

I have a DataGroup with a Custom ItemRenderer. 我有一个带有自定义ItemRenderer的数据组。 Within the itemrenderer, there are 2 states. 在itemrenderer中,有2个状态。 normal and hovered. 正常且徘徊。 I have a <s:Group> within the itemrenderer that shows a bunch of data but i only want to be shown when hovered so I can do includeIn="hovered" which is good. 我在itemrenderer中有一个<s:Group>,它显示了一堆数据,但是我只想在悬停时显示,所以我可以做includeIn =“ hovered”,这很好。

the problem is the x,y position of this group needs to be outside the bounds of the container itself. 问题是该组的x,y位置需要在容器本身的范围之外。 much like a tooltip only that this is not a tooltip. 很像工具提示,只是这不是工具提示。

whatever i do, it stays within the bounds of the datagroup. 无论我做什么,它都位于数据组的范围内。 any ideas? 有任何想法吗? or am I missing something simple here? 还是我在这里缺少一些简单的东西?

The behavior you are describing sounds an awful lot like a tooltip/datatip. 您描述的行为听起来非常像工具提示/数据提示。 Why not create your own tooltip skin and assign it to your renderer instead of re-inventing tooltips? 为什么不创建自己的工具提示外观并将其分配给渲染器,而不是重新发明工具提示?

EDIT: Based on the comment below, the approach I would consider is to show a custom skinned Panel or ToolTip when entering the hovered state using the PopUpManager.addPopUp method. 编辑:基于下面的评论,我将考虑的方法是使用PopUpManager.addPopUp方法进入悬停状态时显示自定义外观的Panel或ToolTip。 After adding it, then position it where ever you like. 添加后,将其放置在您喜欢的位置。 You'll probably need to change the local coordinates to the global coordinates when moving your popup. 移动弹出窗口时,您可能需要将局部坐标更改为全局坐标。 Then call PopUpManager.removePopUp when exiting the hovered state. 然后在退出悬停状态时调用PopUpManager.removePopUp。 Hope that helps. 希望能有所帮助。

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

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