1.ComboBox读取远程数据
使用Ext.data.Store配合proxy和fields获得从后台返回的数据
var store=new Ext.data.Store({
proxy:{
type:“ajax”,
url:“epartment_controller.php?action=combobox_load”,
reader:{
type:"array"
}
},
fields:["values","text"]
});
后台返回的数据格式:[
["value","text"],
["value1","text1"]
]
1.ComboBox下拉框监听用户选择数据
combo.on(“select”,function(ComboBox){
alert (this.getValue()+"-"+this.getRawValue());
})
2.表单的动态加载
form.add( //创建一个extfield输入控件并通过add添加到form中
new Ext.form.TextField({
xtype:"textfield",
fieldLabel:"UE_ID",
name:"UE_ID",
width:278
})
);
form.doLayout(); //重新布局一次,将这个TextField渲染出来