Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Apache Flex 4.14.0
-
None
Description
In GridItemEditor.save() the sort is removed from the dataProvider, the change is made, and after that the sort is reapplied, but without calling refresh() on the collection. This effectively means that we're fooling the dataProvider into thinking that its items are correctly sorted according to the sort properties (by this I mean that if we call getItemIndex, it will use its sort info to find it, thinking everything is in order), when in fact the order is now practically random. Yes, this can be a problem when trying to remove the selected item (see FLEX-34837), but it's much wider than that: usually a dataProvider is accessed by the developers long after it's assigned to a DataGrid, and they expect (especially if it wasn't sorted to begin with) that getItemIndex() will work correctly for their custom code. But due to this bug it will often return -1.
Steps to reproduce:
- Run the attachment to
FLEX-34837and repeat the steps for the "Name" column instead of the "Street" one.
Attachments
Issue Links
- blocks
-
FLEX-34837 DataGrid sorted with complex dataField doesn't keep track of changes to those fields, leading to RTE when trying to remove selected item
- Resolved
- relates to
-
FLEX-4705 ArrayCollection.removeAll throws error if bound to sorted DataGrid
- Closed