日期:2014-05-16  浏览次数:20351 次

Extjs 中ComboBox的使用
	       function add(){
	       var mstore=new Ext.data.JsonStore({
	       url:"deptment!findAll.action",
	       root:"deptments",
	       idProperty:"id",
	       fields:['id','deptmentName','deptmentInfo']
	       });
	       var cb=new Ext.form.ComboBox({
	       fieldLabel:"请选择部门",
	       name:"depementid",
	       anchor:"70%",
	       store:mstore,
	       displayField:'deptmentName',
	       valueField:'id',
	       triggerAction: 'all'
	       });
	       mstore.load();

	       var win=new Ext.Window({
	       title:"用户添加",
	       width:300,
	       height:300,
	       items:{
	       xtype:"form",
	       layout:"form",
	       items:[{xtype:"textfield",fieldLabel:"姓名",name:"userName",anchor:"70%"},
	       {xtype:"textfield",fieldLabel:"密码",name:"passWord",anchor:"70%"},
	       {xtype:"textfield",fieldLabel:"电话",name:"",anchor:"70%"},
	       {xtype:"textfield",fieldLabel:"地址",name:"",anchor:"70%"},
	       {xtype:"textarea",fieldLabel:"备注",name:"",anchor:"70%"}
	       ,cb
	       ]}
	       })
	       win.show();
	       }
?