Kristof
Kristof

Reputation: 314

Flex: Remove an item from a list but keep it in the data provider

I am fairly new to the whole Flex world and I am kinda lost now. I have an mx:List component binded to a XML Data provider. Now I want to remove an item from the list component and mark the item as delted in the data provider, without actually removing it.
I already tried the following approach:

dp_galleryXML..group.(@id == list_category.selectedItem.@id)[0].@status = "delete";
list_category.removeChildAt(list_category.selectedIndex);

The status in the XML file changes, but the item remains in the list. Any tipps on this?

Upvotes: 0

Views: 764

Answers (1)

Florian F
Florian F

Reputation: 8875

What you can do is wrap your XML in a XMLListCollection and then assign it a filterFunction. In your filterFunction, check the status property of your node and returns false if the status is set to delete.

Upvotes: 3

Related Questions