To situate things I am working on a translation utility with a datagrid having 3 columns : translation code, reference text and target text.
The DataGrid's dataProvider property is bound to an ArrayCollection instance. The user can edit the grid and on a successful edit, the underlying collection is updated using the setItemAt() method. The collection also has a filter function to make it easier to find certain texts.
When the user clicks the 'apply filter' button the filter function is updated. This works well. The problem I have is that rows are hidden as soon as the underlying collection item change in a way that doesn't comply with the filter. The row is hidden immediately, which is not very user friendly. Rows should only hide (or be shown) when the 'apply filter' button is pressed.
I'm searching for a way to make this happen.
I assume you mean that the DataGrid's dataProvider is bound to an ArrayCollection instance?
Anyway, if you want to filter the DataGrid's dataProvider then that will remove rows from the DataGrid. You can remove the filter to add them back in. Something, conceptually like this:
collection.filterFunction = null; collection.refresh();
If you are using the dataProvider as a source for multiple components, you can keep the filtering separate by using a different ListCollectionView for each one, but with the same source. Something like this:
component1.dataProvider = ListCollectionView(mySource); component1.dataProvider = ListCollectionView(mySource);
Now applying a filter to one dataProvider will not affect the other.
If this doesn't help, you'll need to expand on the issue you're having and perhaps provide sample code.
After asking and looking around, I determine that there is no real way to do this. I did solve my problem however, by doing the filtering myself and only keeping a list of 'primary keys'. I then use that list to filter the collection.
The result is that rows can't suddenly disappear when records are changed, which is what I wanted.