maxritti
3 Apr 2012, 9:06 AM
Hi @all,
long time ago i started my experience in ext js. I spend no much time for that in the past.
But today i'm very happy that i wrote my first layout which works fine. :)
In Region west there is a Treepanel with some items and another part for some information.
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [
{ text: "First entry", expanded: false,
children: [
{ text: "Child 1", leaf: true},
{ text: "Child 2", leaf: true},
{ text: "Child 3", leaf: true}
]},
{ text: "Second one", expanded: false,
children: [
{ text: "A", leaf: true},
{ text: "B", leaf: true}
]},
{ text: "Last one", expanded: false,
children: [
{ text: "111", leaf: true},
{ text: "222", leaf: true},
]}
]}
});
var treePanel = Ext.create('Ext.tree.Panel', {
id: 'tree-panel',
title: 'Navigation',
region: 'west',
split: true,
height: 360,
minSize: 150,
store: store,
rootVisible: false,
autoScroll: true
});
Ext.create('Ext.Viewport', {
layout: 'border',
title: 'FirstProject',
items: [{
xtype: 'box',
id: 'header',
region: 'north',
html: '<h1>MyProject</h1>',
height: 30
}, {
layout: 'border',
id: 'layout-browser',
region: 'west',
border: false,
split: true,
margins: '2 0 5 5',
width: 200,
minSize: 10,
maxSize: 200,
items: [treePanel, detailsPanel]
},
contentPanel
],
renderTo: Ext.getBody()
Now i would like to change the content in center panel if i click on some entries from my treepanel.
But i don't know and i don't find any solution in the examples. :-/
I hope that somebody could help some new extjs user.
long time ago i started my experience in ext js. I spend no much time for that in the past.
But today i'm very happy that i wrote my first layout which works fine. :)
In Region west there is a Treepanel with some items and another part for some information.
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [
{ text: "First entry", expanded: false,
children: [
{ text: "Child 1", leaf: true},
{ text: "Child 2", leaf: true},
{ text: "Child 3", leaf: true}
]},
{ text: "Second one", expanded: false,
children: [
{ text: "A", leaf: true},
{ text: "B", leaf: true}
]},
{ text: "Last one", expanded: false,
children: [
{ text: "111", leaf: true},
{ text: "222", leaf: true},
]}
]}
});
var treePanel = Ext.create('Ext.tree.Panel', {
id: 'tree-panel',
title: 'Navigation',
region: 'west',
split: true,
height: 360,
minSize: 150,
store: store,
rootVisible: false,
autoScroll: true
});
Ext.create('Ext.Viewport', {
layout: 'border',
title: 'FirstProject',
items: [{
xtype: 'box',
id: 'header',
region: 'north',
html: '<h1>MyProject</h1>',
height: 30
}, {
layout: 'border',
id: 'layout-browser',
region: 'west',
border: false,
split: true,
margins: '2 0 5 5',
width: 200,
minSize: 10,
maxSize: 200,
items: [treePanel, detailsPanel]
},
contentPanel
],
renderTo: Ext.getBody()
Now i would like to change the content in center panel if i click on some entries from my treepanel.
But i don't know and i don't find any solution in the examples. :-/
I hope that somebody could help some new extjs user.