当前位置: 代码迷 >> JavaScript >> Extjs 中ComboBox的运用
  详细解决方案

Extjs 中ComboBox的运用

热度:121   发布时间:2012-12-28 10:29:05.0
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();
	       }
?
  相关解决方案