Flex 3:转发器中的创建完成警报...有关获取repeater.currentIndex的问题
我有一个中继器来调用一个孩子...我的代码如下:
<mx:Repeater id="projectRP" dataProvider="{projectsHttp.lastResult.project}">
<Block:project id="wholeProject"
projectID="{projectRP.currentIndex}"
workingTitle="{projectRP.currentItem.workingTitle}"
projectTitle="{projectRP.currentItem.projName}"
startDate="{textToDate(projectRP.currentItem.startDate)}"
projectPositions="{XML(projectRP.currentItem.positions)}"
creationComplete="Alert.show(String(projectRP.currentIndex))"
/>
</mx:Repeater>
出于某种原因,creationComplete 部分不是 s
I have a repeater to call a child... my code is as follows:
<mx:Repeater id="projectRP" dataProvider="{projectsHttp.lastResult.project}">
<Block:project id="wholeProject"
projectID="{projectRP.currentIndex}"
workingTitle="{projectRP.currentItem.workingTitle}"
projectTitle="{projectRP.currentItem.projName}"
startDate="{textToDate(projectRP.currentItem.startDate)}"
projectPositions="{XML(projectRP.currentItem.positions)}"
creationComplete="Alert.show(String(projectRP.currentIndex))"
/>
</mx:Repeater>
For some reason, the creationComplete piece isn't s
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当调用creationComplete时,currentIndex不再是当前索引。
要从项目中获取信息,您可以将事件传递给创建完成处理程序并找出其中的索引。如果您的 dataprovider 是一个集合,您可以执行以下操作:
但如果它不是具有 getItemIndex 函数的集合,我认为您将不得不执行循环。也许索引位于 event.currentTarget 中的某个位置...所以也许可以通过调试点来查找它。
By the time creationComplete is called, currentIndex is no longer the current index.
To get info from the item, you can pass the event to a creationcomplete handler and figure out the index somwhere in there. If your dataprovider is a collection you can do this:
But if it's not a collection with getItemIndex function you'll have to do a loop I think. Maybe the index is somewhere in the event.currentTarget... so maybe through a debug point and take a look for it.