问题描述
在大约2年的时间里,我在“ Sencha支持”处创建了一个票证,在其中进行了解释并显示了会破坏整个应用程序的错误。
所以我重新打开了这张票,并询问是否有任何解决方案,因为我们要发布我们的应用程序并需要此生产版本...
答案是“请注意,目前尚无解决问题的时间表……” ..但您可以在等待2年后支付更多的钱..为我们的软件和支持付费。即使是bug。.
所以我想请社区帮助我解决这个问题。
如果使用ExtJS V6.5.3-> 7.2.1创建了以下版本,则使用现代工具包并且必须使用SenchaCmd / SenchaArchitect进行生产构建!
Ext.define('Test.view.main.Main',{
extend: 'Ext.tab.Panel',xtype: 'app-main',requires: [
'Ext.MessageBox','Ext.layout.Fit'
],controller: 'main',viewmodel: 'main',defaults: {
tab: {
iconAlign: 'top'
}
},tabBarPosition: 'bottom',tabBar: {
layout: {
type: 'Box',pack: 'start',overflow: 'scroller'
}
},items: [
// Todo - Replace the content of this view to suit the needs of your application.
{
title: 'Home',iconCls: 'x-fa fa-home',layout: 'fit',// The following grid shares a store with the classic version's grid as well!
items: [{
xtype: 'mainlist'
}]
},{
title: 'Users',iconCls: 'x-fa fa-user',bind: {
html: '{loremIpsum}'
}
},{
title: 'Groups',iconCls: 'x-fa fa-users',{
title: 'Settings',iconCls: 'x-fa fa-cog',bind: {
html: '{loremIpsum}'
}
}
]
});
构建后,您将看到如下错误:
app.js?_dc=1599337408898:46636 Uncaught TypeError: Cannot read property 'update' of undefined
at constructor.applyOverflow (app.js?_dc=1599337408898:46636)
at constructor.setter [as setoverflow] (app.js?_dc=1599337408898:5728)
at Ext.Configurator.configure (app.js?_dc=1599337408898:6036)
at constructor.initConfig (app.js?_dc=1599337408898:6675)
at constructor (app.js?_dc=1599337408898:10235)
at constructor (app.js?_dc=1599337408898:37826)
at constructor.callParent (app.js?_dc=1599337408898:6650)
at constructor (app.js?_dc=1599337408898:46423)
at new Ext.layout.Box (app.js?_dc=1599337408898:6978)
at Ext.Factory.create (app.js?_dc=1599337408898:11479)
applyOverflow @ app.js?_dc=1599337408898:46636
setter @ app.js?_dc=1599337408898:5728
configure @ app.js?_dc=1599337408898:6036
initConfig @ app.js?_dc=1599337408898:6675
constructor @ app.js?_dc=1599337408898:10235
constructor @ app.js?_dc=1599337408898:37826
callParent @ app.js?_dc=1599337408898:6650
constructor @ app.js?_dc=1599337408898:46423
Ext.layout.Box @ app.js?_dc=1599337408898:6978
create @ app.js?_dc=1599337408898:11479
fn @ app.js?_dc=1599337408898:11577
applyLayout @ app.js?_dc=1599337408898:37072
setter @ app.js?_dc=1599337408898:5728
configure @ app.js?_dc=1599337408898:6036
initConfig @ app.js?_dc=1599337408898:6675
constructor @ app.js?_dc=1599337408898:10235
constructor @ app.js?_dc=1599337408898:20866
callParent @ app.js?_dc=1599337408898:6650
constructor @ app.js?_dc=1599337408898:24330
callParent @ app.js?_dc=1599337408898:6650
constructor @ app.js?_dc=1599337408898:36941
callParent @ app.js?_dc=1599337408898:6650
constructor @ app.js?_dc=1599337408898:46669
Ext.tab.Bar @ app.js?_dc=1599337408898:6978
eval @ VM95:3
create @ app.js?_dc=1599337408898:7870
factory @ app.js?_dc=1599337408898:5196
applyTabBar @ app.js?_dc=1599337408898:49637
setter @ app.js?_dc=1599337408898:5728
(anonymous) @ app.js?_dc=1599337408898:5719
updateTabBarPosition @ app.js?_dc=1599337408898:49660
setter @ app.js?_dc=1599337408898:5732
configure @ app.js?_dc=1599337408898:6047
initConfig @ app.js?_dc=1599337408898:6675
constructor @ app.js?_dc=1599337408898:10235
constructor @ app.js?_dc=1599337408898:20866
callParent @ app.js?_dc=1599337408898:6650
constructor @ app.js?_dc=1599337408898:24330
callParent @ app.js?_dc=1599337408898:6650
constructor @ app.js?_dc=1599337408898:36941
tabtest.view.MyTabPanel @ app.js?_dc=1599337408898:6978
eval @ VM95:3
create @ app.js?_dc=1599337408898:7870
launch @ app.js?_dc=1599337408898:50015
onBeforelaunch @ app.js?_dc=1599337408898:36111
onProfilesReady @ app.js?_dc=1599337408898:36065
constructor @ app.js?_dc=1599337408898:36045
tabtest.$application @ app.js?_dc=1599337408898:6978
(anonymous) @ app.js?_dc=1599337408898:36227
invoke @ app.js?_dc=1599337408898:8964
doInvokeAll @ app.js?_dc=1599337408898:8989
invokeAll @ app.js?_dc=1599337408898:8971
handleReady @ app.js?_dc=1599337408898:8945
(anonymous) @ app.js?_dc=1599337408898:8953
elevate @ app.js?_dc=1599337408898:2426
timerFn @ app.js?_dc=1599337408898:4115
setTimeout (async)
defer @ app.js?_dc=1599337408898:4117
handleReadySoon @ app.js?_dc=1599337408898:8951
fireReady @ app.js?_dc=1599337408898:8936
doReadyEvent @ app.js?_dc=1599337408898:9027
onReadyEvent @ app.js?_dc=1599337408898:9015
bind @ app.js?_dc=1599337408898:8906
(anonymous) @ app.js?_dc=1599337408898:9114
(anonymous) @ app.js?_dc=1599337408898:9115
解决方法
请参阅Ext.tab.Bar
的文档:
TabBar由Ext.tab.Panel内部使用,通常不需要手动创建。
...甚至没有layout
配置-也没有布局box
;仅hbox
和vbox
。
您需要新的布局。
classic
requires: [...,'Ext.layout.container.Box']
modern
requires: [...,'Ext.layout.Box']
通常,如果某些东西在开发人员而不是生产环境中有效,那么您会缺少需求。 从您发布的代码中,我无法确切说明您如何需要viewModel和viewController。 首先尝试将以下内容添加到app文件夹中的Application.js并从app.js中删除需求:
requires: [
'Test.*','Ext.*'
],
这会将所有内容添加到您的构建应用程序。 !!!虽然我不建议以这种方式发货。 !!!
背景: 如果添加面板,则需要动态添加大量需求。 但是您的应用程序中至少需要一次额外的布局。
在更改代码时,请尝试使用最佳实践
viewModel: {type: 'main'},
,
尝试在您的要求配置中包括Ext.layout.overflow.Scroller
:
requires: [
'Ext.MessageBox','Ext.layout.Fit','Ext.layout.overflow.Scroller'
],
对我有用。