views:

17

answers:

1

I want to remove an item from my dataprovider where the label in dataprovide is "zee4"

I tried:

var removeThis:Object = mylist.dataProvider[selIndex].alias;
mylist.dataProvider.removeItem(removeThis);

But this does not work. I cannot use removeItemAt because I don't know the index number. I need to remove as per the alias itself. The alias is a unique field.

+1  A: 

Try this:

var removeThis:Object = mylist.dataProvider[selIndex];
mylist.dataProvider.removeItem(removeThis);

The reason your method is not working, is because removeThis is not an item in dataProvider. Its a property in the item that is in dataProvider.

Gabriel McAdams