Flex Datagrid 编辑同一行中的单元格不会触发集合更改事件
我正在使用 Flex 数据网格来允许用户编辑一些数据。我的更新过程依赖于更新类型的 CollectionEvent。基本上我捕获此事件打包值并更新数据库。 但是,如果用户编辑单元格,然后移动到编辑同一行中的单元格,则值会更新,但不会触发集合事件。仅当单击行外时才会触发该事件。有没有人有这方面的经验。我听说数据网格有点古怪,这是其中之一还是我做错了?
任何帮助表示赞赏。
I am using the flex datagrid to allow the user to edit some data. My update process relies on a CollectionEvent of type update. Basically I catch this event package the values and update the database.
However, if the user edits a cell then moves to edit a cell in the same row the value is updated but a collection event is not fired. Only when clicking out of the row the event is fired. Has anyone had experience with this. I have heard the datagrid is a little quirky is this one of those quirks or am I doing this all wrong?
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是有道理的,因为每一行都是集合中的一个对象,所以它只会在您完成编辑集合中的对象时调度事件(而不仅仅是集合中对象的属性)。
我建议您使用一个更好的事件,每次完成编辑 dataGrid 单元格时都会调度该事件:尝试使用“itemEditEnd”
http://livedocs.adobe.com/flex/3/html/help.html?content=celleditor_7.html
上述链接的第一个示例使用
我建议您使用类似的方法来更新数据。
请告诉我这是否有帮助,谢谢!
That makes sense that it would act like that since each row is an object in the collection, it would only dispatch the event when you are done editing the object in the collection (no just the property of the object in the collection).
I suggest you use a better event that gets dispatched every time you finish editing a dataGrid cell: Try using "itemEditEnd"
http://livedocs.adobe.com/flex/3/html/help.html?content=celleditor_7.html
the first example of the above link uses
I suggest you use a similar approach for updating your data.
Let me know if this helps, thanks!