点击事件不工作柔性
我有一个作为数组列表作为数据提供者的列表。它有一个内联项目渲染器,它有图像控制。单击事件不适用于图像 ctrl。代码看起来像这样
<s:ArrayList id="allActionsArrList">
<fx:Object click="showList('Portlet')" source="@Embed('images/bpc1.jpg')" />
<fx:Object click="showList('Pages')" source="@Embed('images/Tab.png')" />
<fx:Object click="smsClick()" source="@Embed('images/launchpad_tel.png')" />
<fx:Object click="logoutImg_clickHandler(event)" source="@Embed('images/logoutS.swf')" />
</s:ArrayList>
<s:List id="actionStripList" bottom="0" width="100%" borderColor="black"
borderVisible="true" contentBackgroundAlpha="0" dataProvider="{allActionsArrList}"
useVirtualLayout="false">
<s:layout>
<s:TileLayout/>
</s:layout>
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer width="100%" height="40">
<mx:Image buttonMode="true" horizontalCenter="0"
width="40" height="40" source="{data.source}" click="{data.click}"/>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
任何想法。提前致谢!
I have a list that as an arraylist as a dataprovider.It has an inline item renderer thet has image control. The click event doesn't work for the image ctrl.The code looks like this
<s:ArrayList id="allActionsArrList">
<fx:Object click="showList('Portlet')" source="@Embed('images/bpc1.jpg')" />
<fx:Object click="showList('Pages')" source="@Embed('images/Tab.png')" />
<fx:Object click="smsClick()" source="@Embed('images/launchpad_tel.png')" />
<fx:Object click="logoutImg_clickHandler(event)" source="@Embed('images/logoutS.swf')" />
</s:ArrayList>
<s:List id="actionStripList" bottom="0" width="100%" borderColor="black"
borderVisible="true" contentBackgroundAlpha="0" dataProvider="{allActionsArrList}"
useVirtualLayout="false">
<s:layout>
<s:TileLayout/>
</s:layout>
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer width="100%" height="40">
<mx:Image buttonMode="true" horizontalCenter="0"
width="40" height="40" source="{data.source}" click="{data.click}"/>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
Any idea.Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1.您可以这样做:
在这里您可能应该处理
this
对象(信息)但我使用了第二种变体。
2.另一种变体是为您的对象项定义一些属性(例如
id
)。然后,您可以在内联 itemRenderer 中使用switch
语句,并根据data.id
调用不同的侦听器。1.You may do something like this:
Here you possibly should take care of
this
object (info)But I'd used the 2nd variant.
2.Another variant is to define some attribute (
id
for example) for your Object items. Then you can useswitch
statement in your inline itemRenderer and call different listeners depending ondata.id
.