I am using Flex 4. The objects that populate my data grid have these two fields: tag and transcribedText. Both of these fields are editable.
When I make a change/changes to the same record, the COLLECTIONEVENT UPDATE event is dispatched more than necessary, creating redundant PropertyChangeEvent objects.
Please refer to the following example. I have screenshots to give more details but am unable to copy/paste or attach them.
1. I first changed the transcribedText from “add services” to “add services TODAY”.
2. I then changed the tag from “OrderGeneral” to “OrderInternet”.
3. I finally clicked outside of the affected line.
The COLLECTIONEVENT UPDATE event is dispatched THREE times.
1. In the first dispatch, there are two PropertyChangeEvent objects, and the second one is a repeat of the first one (transcribedText change) but with oldValue and newValue both set to null.
2. In the second dispatch, there is only one PropertyChangeEvent object, and it correctly captures the tag change.
3. In the third dispatch, there is only one PropertyChangeEvent object, and it is a repeat of the previous tag change but with oldValue and newValue both set to null.
Why is this happening?
Thanks for your help!
The datagrid might be forcing collectionchange events as part of the editing
COLLECTION_CHANGE events are tied to the data provider itself, not to the data grid though.
One interesting observation is that the REMOVE event is dispatched only one time.
When I was using the itemEditEnd event tied to the data grid, I also witnessed that this event was dispatched two times when only one change was made.
Any other thoughts?
Under certain conditions, the DG will call itemUpdated on the dataprovider,
forcing COLLECTION_CHANGE events.
If you set breakpoints you should be able to examine the callstack and find
the source of the dispatch.