combobox 实现下拉列表
tbar : [
{
??? xtype:'tbtext',text:'选择部门:',width:60
},{
??? xtype:'combo',
??? id:'type',
??? name : 'type',
??? width:80,
??? editable: false,??
???? displayField: 'value',?
???? valueField: "value",
???? mode: 'remote',??
????? typeAhead: true,
????? forceSelection: true,//必须选择一项?
?????? emptyText:'请选择...',//默认值?
?????? triggerAction: "all",
?????? lazyRender:false,??
?????? store: store_Dep
},
]
?
在构造对象之外
var store_Dep = new Ext.data.Store({
??? ??? ??? ? proxy: new Ext.data.HttpProxy({?
??? ??? ??? ???????? url: '<%=basePath%>UserServlet.do?method=queryAllDep'???
??? ??? ??? ? }),?
??? ??? ??? ? reader: new Ext.data.JsonReader({?
??? ??? ??? ??? ??? ??? root: 'records'
??? ??? ??? ??? ??? },[
??? ??? ??? ??? ??????? {name: 'text'},
??? ??????????????????? {name: 'value'}
??? ??? ??? ??? ??? ]
??? ??? ??? ? )?
??? });