[
https://issues.apache.org/jira/browse/FLEX-34838?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Chira resolved FLEX-34838.
--------------------------------
Resolution: Fixed
> getItemIndex returns -1 for item whose property was edited with GridItemEditor
> ------------------------------------------------------------------------------
>
> Key: FLEX-34838
> URL: https://issues.apache.org/jira/browse/FLEX-34838
> Project: Apache Flex
> Issue Type: Bug
> Components: Spark: DataGrid
> Affects Versions: Apache Flex 4.14.0
> Reporter: Mihai Chira
> Assignee: Mihai Chira
> Fix For: Apache Flex 4.15.0
>
>
> 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-34837 and repeat the steps for the "Name" column
> instead of the "Street" one.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)