Scoping issue.  See 
http://livedocs.macromedia.com/flex/2/langref/mxml/component.html

You may be able to access orderItem from within your item renderer 
component by making the function public and calling 
outerDocument.orderItem().

--- In [email protected], "g8torjoe" <[EMAIL PROTECTED]> wrote:
>
> I have a dataGrid control with an itemRenderer containing a 
button. 
> The button has a click handler which is defined as a private 
function
> in the script tags.  Every time I try to compile I get an error:
> "1180: Call to a possibly undefined method orderItem."  A PARTIAL
> piece of the code is below.  I can't seem to figure out why this is
> happening.  Thanks
> 
> <mx:DataGrid id="dgPart" dataProvider="{partList}" 
editable="false">
>   <mx:columns>
>   <mx:DataGridColumn id="partNum" headerText="Part #"
> dataField="PART_NO" editable="false" width="75" sortable="true" />
>   <mx:DataGridColumn id="partName" headerText="Part Name"
> dataField="PART_NAME" editable="false" width="450" />
>   <mx:DataGridColumn id="orderPart" headerText="Order">
>     <mx:itemRenderer>
>       <mx:Component>
>         <mx:Button width="15" height="15" toolTip="Add to Cart"
> icon="@Embed('/assets/shoppingcart_add_16.png')" click="orderItem
()" />          
>       </mx:Component>
>     </mx:itemRenderer>
>   </mx:DataGridColumn>
>   </mx:columns>       
> </mx:DataGrid>
> 
> private function orderItem():void
> {
>   var eventObj:CatalogEvent = new CatalogEvent("order");
>   dispatchEvent(eventObj);
> }
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to