“renderTo”打破了执行

时间:2014-04-30 10:16:52

标签: extjs extjs4

我想在应用程序启动时在页面顶部呈现工具栏。 当viewport.js包含在页面中时,在ext-all-dev.js中运行以下内容。但是当我使用ext-dev.js时,它会抛出异常。Uncaught TypeError: undefined is not a function

Ext.create("Ext.toolbar.Toolbar", {
    renderTo: document.body,
    defaultType: 'button',
    items: [{text: 'foo'}]
    });

它出了什么问题?在控制台中运行上面的代码也适用于ext-dev.jsext-all-dev.js文件。异常堆栈是:

Uncaught TypeError: undefined is not a function AbstractComponent.js?_dc=1398852700374:170
Ext.define.statics.updateLayout AbstractComponent.js?_dc=1398852700374:170
Ext.define.updateLayout AbstractComponent.js?_dc=1398852700374:3319
Ext.define.afterRender Renderable.js?_dc=1398852701043:195
Base.implement.callParent ext-debug.js:4266
Ext.define.afterRender Component.js?_dc=1398852699982:435
Ext.define.finishRender Renderable.js?_dc=1398852701043:458
Ext.define.render Renderable.js?_dc=1398852701043:784
Ext.define.constructor AbstractComponent.js?_dc=1398852700374:1231
Base.implement.callParent ext-debug.js:4266
Ext.define.constructor Component.js?_dc=1398852699982:377
constructor ext-debug.js:4897
(anonymous function) VM11066:3
Ext.ClassManager.instantiate ext-debug.js:5485
(anonymous function) ext-debug.js:2112
(anonymous function) Viewport.js?_dc=1398852703350:51  

0 个答案:

没有答案