我想将“afterrender”侦听器添加到 view.Viewport 以在渲染视口之后执行某些操作。
有人知道该怎么做吗?
我的代码是,
view.Viewport.js
Ext.define('App.view.Viewport', {
extend: 'Ext.container.Viewport',
alias: 'widget.viewport',
.
.
.
控制器.Viewport.js
Ext.define('App.controller.Viewport', {
extend: 'Ext.app.Controller',
init: function (application) {
if (this.inited) {
return;
}
this.inited = true;
//console.log(this.getViewport());
this.getViewport().addListener('load', function () {
console.log('AFTER RENDER'); // it does not work....
});
.
.
.
谢谢!