ExtJS里自定义对象,extent: 'Ext.form.Panel', 调用render()无效

Eks 2014-09-13 11:53:03
如题。代码如下:
Ext.define('Project.form.queryForm', {
extent: 'Ext.form.Panel',
title: '查询条件',
render: function(function(container, position) {
......
this.callParent(container, position);
}
});
提示:this.callParent() was called but there's no such method (render) found in the parent class (Ext.Base)。
...全文
100 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eks 2014-09-30
  • 打赏
  • 举报
回复
我是想要在重载的 render() 函数中先作相关初始化后,再调用 Ext.form.Panel原生的 render()。 因此,在constructor() 中 this.callParent() 没用。 现在把功能放在 initComponent() 函数中解决此问题了。
Go 旅城通票 2014-09-13
  • 打赏
  • 举报
回复
放到constructor:配置里面调用this.callParent(container, position);试试

Ext.define('Project.form.queryForm', {
extent: 'Ext.form.Panel',
title: '查询条件',
constructor:function(){
this.callParent(arguments);
},
render:function(container, position) {//这里也多了个function
......
//this.callParent(container, position);
}
});

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧