flex dataGrid中的计算问题
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.CheckBox;
import mx.events.FlexEvent;
import mx.collections.ArrayCollection;
import mx.events.AdvancedDataGridEvent;
[Bindable]
private var dataSource:ArrayCollection=new ArrayCollection([
{id: 1,dengyu:'='},
{id: 2,dengyu:'='},
{id: 3,dengyu:'='},
{id: 4,dengyu:'='},
{id: 5,dengyu:'='},
{id:'合计:',num1:'',num2:'',dengyu:'---',sum:''}
]);
]]>
</mx:Script>
<mx:AdvancedDataGrid id="adGrid" sortExpertMode="true"
width="300"
height="253"
fontSize="14"
dataProvider="{dataSource}"
x="262.5"
y="203"
editable="true"
>
<mx:columns>
<mx:AdvancedDataGridColumn headerText="序号" width="150" textAlign="center"
dataField="id" editable="false"/>
<mx:AdvancedDataGridColumn headerText="参数1" width="200"
dataField="num1" editable="true"/>
<mx:AdvancedDataGridColumn headerText="参数2" width="200"
dataField="num2" editable="true"/>
<mx:AdvancedDataGridColumn headerText="=" width="150" textAlign="center"
dataField="dengyu" editable="true"/>
<mx:AdvancedDataGridColumn headerText="求和" width="200"
dataField="sum" editable="false" />
</mx:columns>
</mx:AdvancedDataGrid>
</mx:Application>
代码如上:界面效果运行一下即可,想实现当光标离开时求和功能 和 最后行的合计功能 不知怎么实现,试了试itemFocusOut事件,但是达不到效果,请高手指教,谢谢!
[解决办法]