从 ExtJs3 升级到 ExtJs4 时出错 - “成员未定义”在兼容模式下?

发布于 2024-11-05 22:16:08 字数 493 浏览 0 评论 0原文

我正在将我的项目从 Ext3.3 更新到 Ext4。
添加新的 ext4 ext-all-debug.js 之后,我添加了 ext3-core-compat.jsext3-compat.js 文件> 文件。

我在 ext-all-debug.js 的第 3262 行收到 members is udefine 错误
它位于 Ext.extend 方法内,该方法接受 3 个参数:

Ext.extend = function(subclass, superclass, members) 

我可以从 ExtJs4 文档中看到 Ext.extend 已弃用,但是我只想在更改所有 Ext.extend 到 Ext.define

大家有什么帮助吗?

I'm updating my project from Ext3.3 to Ext4.
I have added the ext3-core-compat.js and ext3-compat.js files after added the new ext4 ext-all-debug.js file.

I am getting a members is udefined error on line 3262 of ext-all-debug.js.
Which is inside the Ext.extend method which accepts 3 parameters:

Ext.extend = function(subclass, superclass, members) 

i can see from the ExtJs4 documentation that Ext.extend is deprecated, however I just want to get my code working before I change all of my Ext.extend to Ext.define.

Any help guys?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吾性傲以野 2024-11-12 22:16:08

我假设您使用的是匿名构造函数语法,就像这样?

MyClass = function(config) {
    ...
}
Ext.extend(MyClass, SomeOtherClass, {
    ...
});

如果是这样,则 Ext4 或 compat 层无法检测到此形式,并且必须手动更新为新的标准 Ext.define 语法。我不确定迁移文档中当前是否提到了这一点,如果没有,我将添加它。

I assume that you're using the anonymous constructor syntax, like this?

MyClass = function(config) {
    ...
}
Ext.extend(MyClass, SomeOtherClass, {
    ...
});

If so, this form cannot be detected by Ext4 or the compat layer and must be updated manually to the new standard Ext.define syntax. I'm not sure if this is currently mentioned in the migration documentation, and if not I'll add it.

秉烛思 2024-11-12 22:16:08

假设您已按照 ExtJS 3 到 4 迁移指南中的步骤操作,我认为除了手动检查您的应用程序并进行更改之外,没有其他可以做的事情。根据 Sencha 关于迁移的博客文章(强调矿):

Ext JS 3 兼容层

这由一组文件组成,当包含在 Ext JS 4 之后时,这些文件将提供覆盖,引导现有的 Ext JS 3 代码在 Ext JS 4 下运行。这一层的目标不是让您的应用程序能够在未经修改的情况下运行在 Ext JS 4 下长期有效。相反,您应该期望仅使用此层作为完全迁移到 Ext JS 4 的临时手段。提供它的目的是帮助尽可能快速、轻松地进行过渡。您将能够使用兼容层更快地将应用程序恢复到渲染和功能状态,而不是从空白屏幕调试模糊错误,从而使开始迁移到最新架构变得更加容易。

Assuming that you have followed the steps in the ExtJS 3 to 4 migration guide, I don't think that there is much else that can be done other than to manually go through your application and make the changes. According to Sencha's blog post on the migration (emphasis mine):

Ext JS 3 Compatibility Layer

This consists of a set of files that, when included after Ext JS 4, provide overrides that will bootstrap existing Ext JS 3 code to run under Ext JS 4. The goal of this layer is not to enable your application to run unmodified under Ext JS 4 long-term. On the contrary, you should expect to use this layer only as a temporary means of migrating fully to Ext JS 4. The purpose of providing it is to help make the transition as swift and painless as possible. Rather than debugging obscure errors from a blank screen, you will be able to get your application back into a rendered and functional state much more quickly using the compatibility layer, making it dramatically easier to start migrating to the latest architecture.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文