3

我有一个 JSON 存储定义如下

var subAccountStore = new Ext.data.JsonStore({
  autoLoad: true,
  proxy: {
    type:'ajax',
    url : '/opUI/json/subaccount.action?name="ABC"'
  },
  fields: ['accountName', 'quantity','accountNumbers'],
  listeners: {
    load: function(store, records, success) {
      // ???????
    },
    single: true
  }
});

样本数据是

[{"accountName":"'ABC'","quantity":100,"accountNumbers":['12345A','12345B','12345C']},{"accountName":"'XYZ'","quantity":100,"accountNumbers":['99999A','99999B','99999C']}]

如何动态创建商店accountNumbers并分配给网格内的组合框?

谢谢塔拉汉

4

1 回答 1

0

对于帐号,您必须单独声明商店。例如,在面板项目中

items: [{
xtype: 'combobox',
id: 'addObjectComboCopy',
fieldLabel: '<h style= "color:red;">*</h> accountNumbers',
store: addFormStore,
displayField: 'select',
valueField: 'name',
editable: false,
allowBlank: false

}]

这里Store必须声明如下

var addFormStore = Ext.create('Ext.data.Store', {
fields: ['name', 'select'],
data: [
    {"name": "01", "select": "12345A"},
    {"name": "02", "select": "12345B"},
    {"name": "03", "select": "12345C"}
]

});

于 2018-05-03T09:59:54.153 回答