在同步组合框和组合框中协调加载初始值的最佳方法是什么?列表框
环境:Flex/As3/Cairgorm/composite 组件。 我有两个组合框和两个数据网格,这样选择组合框 1 时,会将数据插入组合框二和第一个数据网格中。选择组合框 2 会将数据插入到数据网格 2 中。
我已经设置了更改事件,以便每个组合框上的用户选择都能做正确的事情。问题在于,在组合框的初始加载时,更改事件不会触发,并且后续同步数据加载不会发生。
组合框初始化后是否有一个事件用于获取所选项目(第一项)?
Environment: Flex/As3/Cairgorm/composite component.
I have two comboboxes and two datagrids such that the selection of combobox 1, inserts data into combobox two and the fist datagrid. The selection of combobox 2 inserts data into datagrid 2.
I have setup the change event so that the user selection on each of the combo boxes do the right thing. The problem is that on the initial load of the comboboxes, the change event does not fire and subsequent synchronization data loading does not happen.
Is there an event for getting the itemselected (1st item) after the combobox is initialized?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了自己的答案。在每个组合框上使用 updateComplete 事件就可以达到目的。
[编辑]
事实证明 updateComplete 没有按预期工作。我真正需要的是 dataChange 事件。但是,即使组合框被列为该组件的有效 FlexEvent,该事件似乎也不会触发。
我尝试了许多其他事件(valueCommit、creationComplete、initialize),但所有这些事件都会多次触发,与更改重叠,并且对于此用例没有用处。
最后,我创建了一系列初始化路径和更改路径的调用链。
如果其他人有更好的方法,我会很感兴趣。
I found my own answer. Using the updateComplete event on each of the comboboxes did the trick.
[EDIT]
It turns out that updateComplete did not work as expected. What I really needed is the dataChange event. However, it appears that this event does not fire for comboboxes even though it is listed as a valid FlexEvent for this component.
I tried a number of other events (valueCommit, creationComplete, initialize) but all of these fire multiple times, overlap with change, and are not useful for this usecase.
In the end, I created a gludge of a chain of calls for the initialize path and change path.
If anyone else has a better way, I'd be very interested.