В extjs 5 создал небольшой сайт с левой панелью (меню) и правой панелью, где отображается контент, вызванный в меню. При нажатии кнопок новый контент добавляется, а старый не удаляется. Как правильно добавлять контент?
Ext.define('VCB.view.PanelLeft',{
extend: 'Ext.panel.Panel',
alias: 'widget.PanelLeft',
xtype: 'toolbar',
collapsible: true,
layout: {
type: 'vbox',
align: 'left'
},
items: [{
xtype: 'component',
reference: 'VCB',
cls: 'sencha-logo',
html: '<div class="main-logo"><img src="resources/logo.png">Sencha</div>',
height: 80
},{
xtype: 'button',
text: 'Анкета',
width: '100%',
height: 40,
handler: function(){
var anketa = new Ext.create('Ext.panel.Panel', {
items: {
xtype: 'Anketa',
// height: 200,
renderTo: 'rr'
}
});
anketa.show();
console.log('Анкета');
}
},{
xtype: 'button',
text: 'Кнопка 1',
width: '100%',
height: 40
},{
xtype: 'button',
text: 'Кнопка 2',
width: '100%',
height: 40,
handler: function(){
var HistoryOrderGrid = new Ext.create('Ext.panel.Panel', {
items: {
xtype: 'HistoryOrderGrid',
// height: 200,
renderTo: 'rr'
}
});
HistoryOrderGrid.show();
}
}, {
xtype: 'button',
text: 'Кнопка 3',
width: '100%',
height: 40
}
]
});
Продвижение своими сайтами как стратегия роста и независимости