`
wjm901215
  • 浏览: 148153 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

EXTJS combo动态加载 默认初始值

阅读更多

 var combo = new Ext.form.ComboBox({
  store : store,
  valueField : "id",
  displayField : "name",
  editable : false,
  allowBlank : false,
  blankText : "请选择",
  name : 'rechargeType',
  id : 'rechargeType',
  triggerAction : 'all',
  hiddenName : 'rechargeTypeIdKey',
  width : 150
 });

 

var store = new Ext.data.JsonStore({
  autoDestroy : true,
  url : '',
  storeId : 'comboCardTypeStore',
  root : 'typeList',
  idProperty : 'typeId',
  fields : ['name', 'id'],
  listeners : {
   load : function(store, record, opts) {
    var combo = Ext.getCmp('rechargeType');
    combo.setValue(record[0].data.typeId);
    combo.setRawValue(record[0].data.typeName)
   }
  }
 });

store.load();

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics