4,328
社区成员
发帖
与我相关
我的任务
分享
<mx:DataGrid headerHeight="28" dataProvider="{totalItems}" sortableColumns="false"
rowHeight="27" width="100%" verticalAlign="middle" height="140" id="dgQuotaReport">
<mx:columns>
<mx:DataGridColumn width="160" headerText="费用项目" dataField="costItemName" />
<mx:DataGridColumn width="100" headerText="全年可申请费用" dataField="totalCost" />
<mx:DataGridColumn width="100" headerText="月均费用" dataField="average" />
<mx:DataGridColumn headerText="已下达情况" dataField="issuededThings"/>
<mx:DataGridColumn width="190" headerText="本次申请范围" dataField="costRange">
<mx:itemRenderer>
<mx:Component>
<mx:HBox width="100%" verticalAlign="middle" horizontalGap="0">
<mx:TextInput text="申请到:" backgroundColor="#f7f7f7" width="60" editable="false" borderStyle="none" />
<mx:ComboBox width="90" id="cbCostRange" labelField="name" change="costRangeChange()">
<mx:Script>
<![CDATA[
import com.jrosion.pojo.FlexCustomQuotaCost;
import com.jrosion.pojo.FlexKrSysQueryDefend;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import com.jrosion.comas.JrFbCore;
[Bindable]
private var curCostRange: ArrayCollection = new ArrayCollection();
private var jrFbCore:JrFbCore = new JrFbCore();
private var _curData: FlexCustomQuotaCost = new FlexCustomQuotaCost();
override public function set data(value:Object) : void {
super.data = value;
_curData = FlexCustomQuotaCost(value);
curCostRange = jrFbCore.getCostRequestTimeRange(value.issuededCostRange);
cbCostRange.dataProvider = curCostRange;
this.cbCostRange.selectedIndex = curCostRange.length - 1;
}
private function costRangeChange(): void{
_curData.costRange = Number(FlexKrSysQueryDefend(cbCostRange.selectedItem).qvalue);
_curData.requestCost = _curData.costRange * _curData.average;
super.data = _curData;
super.data.requestCost = _curData.requestCost;
}
]]>
</mx:Script>
</mx:ComboBox>
<mx:TextInput text="(月)" backgroundColor="#f7f7f7" width="40" editable="false" borderStyle="none" />
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="本次申请金额" dataField="requestCost"/>
</mx:columns>
</mx:DataGrid>