Extjs 所有字段均为“;“未定义”;在组合框中
我的组合框字段有点问题。所有这些都是未定义的Extjs 所有字段均为“;“未定义”;在组合框中,extjs,combobox,Extjs,Combobox,我的组合框字段有点问题。所有这些都是未定义的 buildMyCombo : function(label) { var store = new Ext.data.ArrayStore({ fields: ['name', 'value'], data : [ ['.xls', 1], ['.csv', 2], ['.htm', 3] ] }); va
buildMyCombo : function(label)
{
var store = new Ext.data.ArrayStore({
fields: ['name', 'value'],
data : [
['.xls', 1],
['.csv', 2],
['.htm', 3]
]
});
var result = new BGGNE.components.fields.SimpleComboBox({
formFields: {},
enableKeyEvents: true,
store: store,
valueField: 'value',
displayField: 'name',
lazyInit:false,
formFieldDefinition: {
isMandatory: true,
fieldLabel: label,
hideTrigger: false,
selectOnFocus: true,
isEditableInDialog: false,
type: {
kind: 'local',
type: 'Text',
selectableValues: 'name'
},
renderAsExtField: true,
isOnAPropagation: true,
forceSelection: true
}
});
result.on('focus', function ()
{
result.doQuery('', true);
}, this);
result.on('select', this.onComboSelect, this);
return result;
},
所以,我应该看到store中的3项,而不是只看到3项“未定义”。所以,我相信组合框读取商店,因为它知道我在那里有多少物品。但由于某些原因,未定义的文本会显示出来 我自己设法解决了这个问题。问题是我需要把这个代码
store: store,
valueField: 'value',
displayField: 'name',
在formFieldDefinition中。SimpleComboBox扩展ComboBox时,一些代码被覆盖,formFieldDefinition是定义列表项的字段
如果这个问题是在浪费你的时间,谢谢并道歉 我怀疑这段代码是我的问题:“type:{kind:'local',type:'Text',selectableValues:'name'}”,但是如果我删除它,就会出现很多错误。这意味着我一定错过了一些配置。@Robby Pond:SimpleComboBox扩展了ComboBox