我想从itemRenderer调用名为“ edit_groups()”的父函数。
我的itemRenderer的代码是:

<mx:VBox id="vbx_container" paddingBottom="4" paddingLeft="4" paddingRight="4" paddingTop="4" borderStyle="solid"
    dropShadowEnabled="true" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
    <mx:Canvas width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
        <mx:Image id="image" width="100" height="100" source="{data.thumb}" scaleContent="true" maintainAspectRatio="true"
            complete="{image_smoothing_handler(event);}" trustContent="true" doubleClick="{CALL THE PARENT FUNCTION "edit_groups()"}"/>
    </mx:Canvas>
</mx:VBox>


我从类似的应用程序调用我的itemRenderer:

list_groups_modify.itemRenderer=new ClassFactory(groups.list_groups_modify_item_renderer);

<mx:Label text="{data.label}" textAlign="center" maxWidth="60" toolTip="{data.label}"/>


问候
Zeeshan

最佳答案

使用parentDocument尝试以下操作:

<mx:VBox id="vbx_container" paddingBottom="4" paddingLeft="4" paddingRight="4" paddingTop="4" borderStyle="solid"
    dropShadowEnabled="true" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
    <mx:Canvas width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
        <mx:Image id="image" width="100" height="100" source="{data.thumb}" scaleContent="true" maintainAspectRatio="true"
            complete="{image_smoothing_handler(event);}" trustContent="true" doubleClick="parentDocument.edit_groups()"/>
    </mx:Canvas>
</mx:VBox>

08-25 14:46