zoukankan      html  css  js  c++  java
  • Extjs4 修改combox中store的数据

        {
              xtype:        "combo",
              fieldLabel:   '选择模板',
              name:        "TemplateType",
              fieldName:   "TemplateType",
              displayField: 'TemplateName',
              valueField:   'SettingId',
              store:        Ext.create('Ext.data.Store', {
                fields: ['SettingId', 'TemplateName', 'Content'],
                data: [{SettingId: 0, TemplateName: '空白模板', Content: ''}]
              }),
                      300,
              labelWidth:   77,
        }
            var templateCombo = this.panel.query("[name=TemplateType]");  //获取combox的元素组件
            if (templateCombo) {
              var storeData = [{SettingId: 0, TemplateName: '空白模板', Content: ''}];
              for(var j=1;j<5;j++){
                storeData.push({SettingId: j, TemplateName: 'TemplateName'+j, Content: 'Content'+j});
              }
              var newStore = Ext.create('Ext.data.Store', {
                fields: ['SettingId', 'TemplateName', 'Content'],
                data: storeData
              })
              templateCombo.bindStore(newStore);

    //之前考虑使用store.loadData(),来修改数据,结果发现在首次加载时,就需要修改数据,无法正常加载,最后就使用了上面的bindStore方法
    }



  • 相关阅读:
    UVa10917
    T^T online judge 2952
    AcWing 105.七夕祭
    AcWing 99.激光炸弹(二维前缀和)
    AcWing 97.约数之和
    AcWing 95. 费解的开关
    ccf/csp 2018 12 小明放学
    BNUOJ 33535 Final Exam Arrangement
    分块
    sublime安装配置
  • 原文地址:https://www.cnblogs.com/wind-wang/p/11592557.html
Copyright © 2011-2022 走看看