将 ExtJs3 转换为 ExtJs4?
这源于我之前的问题此处。
我使用 ExtJs 3.x 进行开发已经大约一年了,我想迁移到 ExtJs4。
我习惯于对 extJs 文件进行如下编码:
ReportsPanel = function(config){
config = config || {};
function dummyFunction(){
//I would usually have methods in this file also.
}
Ext.apply(config, {
title: 'Reports',
layout: 'border',
id: 'reportsPanel',
closable: 'true',
items: []
});
ReportsPanel.superclass.constructor.call(this, config);
};
Ext.extend(ReportsPanel, Ext.Panel, {
dummy: dummyFunction//Make the dummy function available to call
});
并在必要时使用 new ReportsPanel()
实例化它。
我看过许多不同的 ExtJs 4 代码示例,说实话我有点困惑。
我知道我应该使用 Ext.define 方法。我似乎无法理解它。
上面的例子转换成 ExtJs4 应该是什么样子?
This leads on from my previous question here.
I have been developing with ExtJs 3.x for about a year now and I want to migrate to ExtJs4.
I am used to coding my extJs files like below:
ReportsPanel = function(config){
config = config || {};
function dummyFunction(){
//I would usually have methods in this file also.
}
Ext.apply(config, {
title: 'Reports',
layout: 'border',
id: 'reportsPanel',
closable: 'true',
items: []
});
ReportsPanel.superclass.constructor.call(this, config);
};
Ext.extend(ReportsPanel, Ext.Panel, {
dummy: dummyFunction//Make the dummy function available to call
});
And instantiating this with new ReportsPanel()
wherever neccessary.
I have looked at many different examples of ExtJs 4 code and to be honest I'm a little confused.
I know that I should be using the Ext.define
method. I just cant seem to get my head around it.
What should the above example converted into ExtJs4 look like?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可能看起来像这样:
It could look like this: