Arrays in Flex and Flash are not watched for changes.  After you mutate
the array you have to set it again.

 

var tmp:Array = myGrid.selectedItems

tmp += item;

myGrid.selectedItems = tmp;

 

If you see something that takes an ArrayCollection then it is watched
for changes.  IOW, the grid did not know you added an item to its
selectedItems array.

 

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of qnotemedia
Sent: Wednesday, March 14, 2007 4:27 PM
To: [email protected]
Subject: [flexcoders] Re: Getting "selectedItems" to properly
*select*...

 

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
> If you want to set the selection based on data, you'll have to loop
> through all the items, inspect whether each item has the data you
> want, and select it if so.

I actually tried something like that. But myGrid.selectedItems += item 
doesn't work. What's the best practice way to push the item to 
selectedItems?

 

Reply via email to