FLEX TreeGrid 编辑完触发事件

  需求:TreeGrid中的单元格编辑完,触发事件,来求这一条数据的和,可是 查了下方法,好像没有TreeGrid编辑完触发的事件,所先只能从单元格的itemEditor来下手了,

    

<mx:DataGridColumn  headerText="* 产区补贴(万元)" id="c_provinceSubsidy" dataField="provinceSubsidy"  textAlign="center" editable="true" >
 <mx:itemEditor>
      <fx:Component>
	<mx:TextInput  restrict="0-9."  visible="{data.leaf}" editable="{data.leaf}"                                       focusOut="outerDocument.detail_tree_focusOutHandler(event)"  width="100%" height="100%"/>
      </fx:Component>
   </mx:itemEditor> 
</mx:DataGridColumn>
///调用父页面的方法。
 public  function detail_tree_focusOutHandler(event:FocusEvent):void
   {
    // TODO Auto-generated method stub
    if(!detail_tree.selectedItem.leaf)
     return;
    var obj:Object = detail_tree.selectedItem;
    var sumProjectCost:Number = Number(obj.countrySubsidy)+Number(obj.provinceSubsidy);
    obj.projectCostFiance = sumProjectCost;
    (detail_tree.dataProvider as ArrayList ).itemUpdated(obj);
   }


昨天用S的DataGrid做表格,也需要编辑完触发事件。但发现按照MX的那样的方法一直弄那个单元格却不能编辑了,搜索了下,发现还得加个<s:GridItemEditor>才可以

	<s:GridColumn dataField="ActualQuantityNumber" headerText="实际件数" minWidth="40"  editable="true"
											   >
								<s:itemEditor>  
									<fx:Component>  
										<s:GridItemEditor>
										<s:TextInput  restrict="0-9."  visible="true" editable="true"                      
													   width="100%" height="100%"/>  
                                         </s:GridItemEditor>
									</fx:Component>  
								</s:itemEditor> 
							</s:GridColumn>


 

你可能感兴趣的:(c,function,object,Flex,tree)