ExtJs的ComboBox赋值与取值

//读取下拉数据 var store = new Ext.data.JsonStore({ url: "Module/ServiceHall/ServiceHall.asmx/ShowServiceHall", fields: ['serviceHall_Name', 'serviceHall_ID'], listeners: {//为了编辑时设定初始值Ext.getCmp("fwz").setValue(2); load: function() { Ext.getCmp('fwz').setValue(Ext.getCmp('fwz').getValue()); } } }); store.load(); // //返回数据示例[{"serviceHall_Name":"名字1","serviceHall_ID":"1"},{"serviceHall_Name":"名字2","serviceHall_ID":"2"}] //////////////formPanel中的下拉ITEM { id: 'fwz', name: 'fwz', xtype: 'combo', hideOnSelect: false, readOnly: false, editable: false, fieldLabel: "所属网点", store: store, typeAhead: true, valueField: 'serviceHall_ID', displayField: 'serviceHall_Name', mode: 'local', triggerAction: 'all', emptyText: '请选择...', selectOnFocus: true, allowBlank: false, readOnly: false, blankText: '请选择所属营业网点', hiddenName: 'serviceHall_ID',//取valueField值用form提交后取该id值 anchor: '90%' }

你可能感兴趣的:(function,url,ExtJs)