I can guide you with what you want to achieve.
If you need a slide navigation then first try this.
I am providing you with an sample code which will give you some idea on your desired layout. Try this view:
Ext.define('Sample.view.Main', {
extend: 'Ext.Container',
xtype: 'main',
requires: [
'Ext.dataview.List'
],
config: {
layout: 'hbox',
cls: 'main',
items: [{
xtype: 'list',
itemTpl: '{title}',
data: [{ title: 'Red', val: 'red' },
{ title: 'Blue', val: 'blue' },
{ title: 'Orange', val: 'orange' },
{ title: 'Purple', val: 'purple' }],
flex: 1,
listeners: {
itemtap: function(el, index, target, record, e) {
var me = this,
element = Ext.get(e.target),
main = element.parent('.main'), //assign the dom of 'Main' view to 'main'
newCls = record.get('val');
if(me.lastAddedCls) {
main.removeCls(me.lastAddedCls).addCls(newCls);
} else {
main.addCls(newCls);
}
me.lastAddedCls = newCls; // Keeps track of last added view so that it can be further removed
}
}
}, {
cls: 'viewTwo',
flex: 2
}]
}
});
Here suppose the first section is navigation panel and second section is you desired variable view 2.
You can now add some styling in a css file(say style.css)
.main.red {
background-color: red;
}
.main.blue {
background-color: blue;
}
.main.purple {
background-color: purple;
}
.main.orange {
background-color: orange;
}
NB: Don't forget to add this css file in bootstrap.json
and app.json
files.
I showed this example by changing the background color. You can try adding and removing views here.
Feel free to ask any query.