首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Ext.form.ComboBox默许选中

2013-08-25 
Ext.form.ComboBox默认选中1.静态数据var data1 []//静态数据var combo1 new Ext.form.ComboBox({???

Ext.form.ComboBox默认选中

1.静态数据

var data1 = [];//静态数据

var combo1 = new Ext.form.ComboBox({
???store: new Ext.data.SimpleStore({
?? ??fields: ['id','name'],? data: [],
?? ??listeners: {
?? ???load: function(store, records, options){
?? ????if(records.length > 0){
???????combo1.setValue(records[0].get(combo1.valueField));
??????}
?? ???}
?? ??}
?? ?}),
?? ?displayField: 'name',valueField: 'id',mode: 'local',width:'200',
?? ?hiddenName:'bean.proType',fieldLabel: '类别',allowBlank: false,
???editable: false,hideTrigger:false,selectOnFocus: true,triggerAction: 'all'
???? });

combo1.getStore().loadData(data1);

?

2.动态数据

var combo2 = new Ext.form.ComboBox({
???store: new Ext.data.SimpleStore({
?? ??fields: ['id','name'],autoLoad:true,
????proxy: new Ext.data.HttpProxy({ url: 'app/listRebate4Combo.do' }),
????listeners: {
?????load: function (store,records,options){
??????if(records.length > 0){
???????combo2.setValue(records[0].get(combo2.valueField));
??????}
?????}
????}
?? ?}),
?? ?displayField: 'name',valueField: 'id',mode: 'local',width:'200',
?? ?hiddenName:'bean.isSale',fieldLabel: '折扣',
???editable: false,hideTrigger:false,selectOnFocus: true,triggerAction: 'all'
???? });

?

?

?

?

?

?

?

?

热点排行