【发布时间】:2016-08-26 23:42:32
【问题描述】:
我有一个表单,其中有一个由我的商店填充的字段:
Ext.define('EcommBackoffice.store.TransactionProviderStatus', {
extend: 'Ext.data.Store',
autoLoad: true,
proxy: {
type: 'ajax',
url: 'resources/data/providerstatus.json',
reader: {
type: 'json',
root: 'providerstatus'
}
},
fields: ['id', 'name']
});
我的商店包含一个简单的商品列表:
{ 提供者状态:[{ id: "过期", 名称:“过期” }, { id:“错误”, 名称:“错误” }, { id:“欺诈”, 名称:“欺诈” }, { id: "付费", 名称:“付费” }, { id: "未确认", 名称:“未确认” }] }
在我的表单中,上面的存储然后由 BoxSelect 填充:
{
xtype: 'boxselect',
name: 'providerstatus',
fieldLabel: oMe.providerstatusField,
width: 468,
store: 'TransactionProviderStatus',
displayField: 'name',
valueField: 'id',
minChars: 2,
typeAhead: true
}
虽然这很有效,但我还打算在用户在其中键入新值时添加更多项目。请注意,此 BoxSelect 是多选。目前,当我在其上输入随机值时,它只会将其清除。
如何设置此特定字段,以便能够添加更多项目,并将其作为提交时传递的数据的一部分?
【问题讨论】:
标签: extjs multi-select