Hey JF,

By external, do you mean custom itemRenderer; like in the DataGridColumn
tag itemRenderer="myItemRenderer"?  If so, the same logic should work. 
Just make sure that buyList is a public variable.  However, it's
probably better to dispatch an event, from the itemRenderer, that
trigers the removal of the item from the dataProvider in the outer
class; or the model preferably.  If it's a popup, the same holds true.

-TH

--- In flexcoders@yahoogroups.com, "jmfillman" <[EMAIL PROTECTED]> wrote:
>
> Below is the sample code for the inline renderer that I need to make
> an external item renderer. Specifically, I need help with this line:
>
> outerDocument.buyList.removeItemAt(outerDocument.cart.selectedIndex);
>
> Whole item renderer
> *************
>
> <mx:itemRenderer>
> <mx:Component>
> <mx:Canvas width="100%" height="42"
> verticalScrollPolicy="off" horizontalScrollPolicy="off">
>
> <mx:Script>
>
> <![CDATA[
>
> [Embed(source="images/trash.PNG")]
>
>
> public var trash:Class;
>
>
>
> public function removeItem():void {
>
> var newCartTotal:Number =
> outerDocument.cartTotal;
>
> var removePrice:Number =
> [EMAIL PROTECTED];
>
> var newTotal:Number =
> newCartTotal - removePrice;
>
>
> outerDocument.buyList.removeItemAt
> (outerDocument.cart.selectedIndex);
>
> outerDocument.total.text =
> outerDocument.cartFormatter.format(newTotal);
>
> outerDocument.cartTotal =
> newTotal;
>
> }
>
>
>
> ]]>
>
> </mx:Script>
>
> <mx:Image source="[EMAIL PROTECTED]" height="38"
> width="51" left="0" top="2"/>
>
> <mx:Label text="[EMAIL PROTECTED]" left="70" top="0.75"
> width="67" textAlign="center"/>
>
> <mx:Label text="[EMAIL PROTECTED]" left="42" top="20"
> width="100" textAlign="center"/>
>
> <mx:Button x="145" top="3" bottom="3" icon="{trash}"
> click="removeItem();"/>
>
>
> </mx:Canvas>
>
> </mx:Component>
> </mx:itemRenderer>
>



Reply via email to