我有以下代码:
<s:DataGrid id="preciosGrid" top="65" width="935" height="379" horizontalCenter="0" requestedRowCount="4"
dataProvider="{clientModel.model.arrayColumnProducts}">
<s:columns>
<s:ArrayList>
<s:GridColumn headerText="edit" width="30" itemRenderer="renderers.EditGridRender"></s:GridColumn>
<s:GridColumn dataField="product" headerText="Product" width="200" editable="false"></s:GridColumn>
<s:GridColumn dataField="provider" headerText="" width="52" editable="true" itemRenderer="renderers.PriceCellItemRenderer"></s:GridColumn>
</s:ArrayList>
</s:columns>
</s:DataGrid>
并且只需要能够从编辑单元格(第一列)捕获双击事件。
我的 itemRenderer 是:
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true"
width="50" height="30">
<fx:Script>
<![CDATA[
import events.EditItemEvent;
import mx.controls.Alert;
override public function prepare(hasBeenRecycled:Boolean):void {}
]]>
</fx:Script>
<s:Image id="btn_edit" horizontalCenter="0" source="@Embed('assets/images/edit_icon.png')"
verticalCenter="0"
doubleClickEnabled="true"
doubleClick="Alert.show('clicked')"/>
如何将点击事件从 ItemRenderer 传递给主应用程序?
谢谢。