我无法在ExtJS中获取组合框来显示下拉项目。我最初使用XmlStore来动态加载数据,但为了确保这不是问题,我使用了一个现有的ComboBox,它使用了一个简单的ArrayStore(并且目前在我的应用程序中工作),以查看它是否工作,仍然没有运气。ExtJS组合框不显示元素
当使用Chrome的开发者工具,当我点击组合框元素,我得到ext-all-debug.js:41166 - Uncaught TypeError: Cannot call method 'getStyle' of undefined
和什么也不显示的下拉菜单。
这里是我的代码:
EventForm = Ext.extend(Ext.form.FormPanel, {
constructor: function(config) {
config = Ext.apply({
items: [
{
layout: 'column',
xtype: 'container',
items: [
{
layout: 'form',
xtype: 'container',
columnWidth: 0.5,
items: [
{
fieldLabel: 'My Combo Box'
name: 'mycombobox',
xtype: 'combo',
store: new Ext.data.ArrayStore({
fields: ['size'],
data: [
['50'],
['100'],
['150'],
['200']
]
}),
displayField: 'size',
valueField: 'size',
forceSelection: true,
editable: false,
triggerAction: 'all',
mode: 'local',
listWidth: 60,
width: 60
}
]
}, {
// another column here similar to above
}
]
}
]
}, config);
EventForm.superclass.constructor(config);
}
});
*刘海头靠在办公桌* - 谢谢你注意到我的愚蠢的错误:) – Jared 2011-05-23 18:12:36