我是 ExtJS 的新手,每次单击 tree.Panel 中的项目时都需要加载新面板
这是我创建新面板的代码(默认情况下)
var contentPanel = Ext.create('Ext.panel.Panel', {
id: 'content-panel',
region: 'center',
layout: 'card',
activeItem: 0,
border: false,
items: [dict_modules['profiles-area']]
});
此代码用于创建 tree.Panel
var treePanel = Ext.create('Ext.tree.Panel', {
id: 'tree-panel',
store: store,
height: '100%',
rootVisible: false
});
这是我的 tree.Panel 点击处理程序
treePanel.getSelectionModel().on('select', function(selModel, record){
if (record.get('leaf')) {
contentPanel.removeAll(true);
contentPanel.add([dict_modules[record.data.id + '-area']]);
contentPanel.doLayout();
}
});
当我的应用程序加载时,它看起来像这样
一旦我点击“专业”,它看起来像这样(好吧(!!!))
但是(!!!),一旦我点击“个人资料”,它看起来像这样(为什么????)
在“内容面板”顶部,您可以看到一些行
如果我再次点击“专业”,它看起来像这样(为什么???)
顶部没有线条!为什么???我做错了什么?