Afterrender事件不适用于我的TabPanel组件。 我的TabPanel代码:
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');
}
}});
我在视图表单面板中使用的此选项卡面板像这样在主视图中添加:
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