Re: ADG - Reacting when icon is clicked
"MacGyverMan" <webforumsuser@macromedia.com> wrote in message
news:ge206t$12p$1@forums.macromedia.com...
> I've got an ADG where each leaf node has one of 2 icons: a plus (if the
> item is
> known as an adder) or a trash can (otherwise).
>
> I've got the icon being set by iconfunction using the attached code.
>
> How do I set it so that the user can click the icon and trigger a given
> function (deleteItem in the case of the trashcan). Do I have to use a
> custom
> itemRenderer with a button instead of an icon? I'd rather not, since I
> can't
> seem to get my item renderers to make sense.
>
>
> public function setIcon(item:Object):Class
> {
> if(item.hasOwnProperty('adder') && item['adder']==1)
> return add;
> else if(!item.hasOwnProperty('children'))//If there are children, the
> node
> is a branch, so we don't want to enable deleting
> return trash;
> return null;
> }
In your itemClick, look at the same information you look at in the
iconFunction property...
|