2 lqxjava lqxjava 于 2015.06.05 09:42 提问

DataGrid创建多行数据 急

主窗口:
<?xml version="1.0" encoding="utf-8"?>



mx:columns








/mx:columns
/mx:DataGrid




/mx:Panel
mx:Script
<![CDATA[
import mx.collections.ArrayCollection;
import mx.managers.PopUpManager;
public var newArr:ArrayCollection;
private function showwindow():void{
//实例u1子窗口对象
var u1:Msg = new Msg();
u1.owner =this;
PopUpManager.addPopUp(u1,this,true);

        }
        private function ChangeLoad():void
        {
           DataGridInfo.dataProvider=newArr;
        }
    ]]>
</mx:Script>

/mx:Application

子窗口:
<?xml version="1.0" encoding="utf-8"?>




mx:Label/
/mx:FormItem


/mx:FormItem


/mx:FormItem




/mx:FormItem


/mx:FormItem


/mx:FormItem


/mx:FormItem


/mx:FormItem


/mx:FormItem

/mx:Form

/mx:Panel
mx:Script
<![CDATA[
import mx.managers.PopUpManager;
import mx.controls.Text;
import mx.collections.ArrayCollection;
public var Arra:ArrayCollection=new ArrayCollection();
private function returnName():void{
var u2:mikn = this.owner as mikn;
u2.newArr=Arra;
u2.labChange.data +=1;
PopUpManager.removePopUp(this);
}
private function tomikn():void{
Arra.addItem({name:named.text,Student:Student.text,gender:gender.selectedValue.toString(),age:age.text,address:address.text,phone:phone.text,email:email.text,professional:professional.text});
returnName();
}
]]>
/mx:Script
/mx:Application
利用ArrayCollection保存数据再在DataGrid中呈现,现在在DataGrid中只能呈现一行,怎么改都改的是第一行数据。

1个回答

Carry_Dominator
Carry_Dominator   2015.06.07 15:48
Csdn user default icon
上传中...
上传图片
插入图片