<?xml version="1.0" encoding="utf-8"?>
<ns:MDIWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
xmlns:ns="http://code.google.com/p/flexlib/" x="0" y="0" creationComplete="mdiwindow1_creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import com.fms.xx.calculate.dbManager.event.DbManagerEvent;
import mx.collections.ArrayCollection;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.events.FlexEvent;
[Bindable]
public var colums:ArrayCollection = new ArrayCollection();
protected function commit_tableInfo_id_clickHandler(event:MouseEvent):void
{
this.dispatchEvent(new DbManagerEvent(DbManagerEvent.COMMINT_TABLEINFO));
}
protected function mdiwindow1_creationCompleteHandler(event:FlexEvent):void
{
var dd:DataGridColumn = new DataGridColumn();
dd.headerText = "哇哈哈";
dd.dataField = "testData";
dg_id.columns = dg_id.columns.concat(dd);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<mx:DataGrid id="dg_id" width="100%" height="100%" editable="true" dataProvider="{colums}" >
<mx:columns>
</mx:columns>
</mx:DataGrid>
<s:Button id="commit_columInfo_id" width="100%" height="5%" label="保存修改"/>
</ns:MDIWindow>
Flex中给DataGrid中新增加一列
最新推荐文章于 2021-09-24 21:04:27 发布