Afterrender 事件不适用于我的选项卡面板组件。 我的选项卡面板的代码:
Ext.define('Admin.view.tabs.Tabs', {
extend: 'Ext.tab.Panel',
shadow: true,
cls: 'demo-solid-background',
tabBar: {
layout: {
pack: 'center'
}
},
activeTab: 1,
defaults: {
scrollable: true
},
items: [
{
title: 'Tab 1',
html : 'By default, tabs are aligned to the top of a view.',
cls: 'card'
},
{
title: 'Tab 2',
html : 'A TabPanel can use different animations by setting <code>layout.animation.</code>',
cls: 'card'
}
],
listeners: {
afterrender: function(corpse) {
console.log('afterrender');
}
}});
我在 View 表单面板中使用此选项卡面板,它添加到主视图中,如下所示:
doCompose: function (to) {
var me = this,
composer = me.composer,
view = me.getView(),
viewModel = me.getViewModel(),
toField;
me.hideActions();
if (!composer) {
me.composer = composer = view.add(
{
xtype: 'compose',
flex: 1
});
if (to) {
toField = me.lookupReference('toField');
toField.setValue(to);
}
viewModel.set('composing', true);
}
}
撰写它是我的包含选项卡面板的表单面板。 我尝试使用官方模板 ExtJs Sencha 中的示例。 查看移动个人资料 撰写电子邮件 https://github.com/syscobra/extjs-admin-dashboard-template/tree/master/modern/src
最佳答案
正如我所说,Ext-JS 6 现代 TabPanel 没有 afterrender 事件。相反,您可以使用 painted
,这是
FIDDLE
listeners: {
painted: function () {
//your code
}
}
关于extjs - afterrender 在 tbpanel Extjs 现代中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53169573/