ines
30 Nov 2006, 8:00 AM
Hello
I had created a BorderLayout like this:
layout = new YAHOO.ext.BorderLayout(document.body, {
hideOnLayout: true,
north: {
split:false,
initialSize: 25,
titlebar: false
},
west: {
split:true,
initialSize: 200,
minSize: 175,
maxSize: 400,
titlebar: true,
collapsible: true,
animate: true,
autoScroll:true,
useShim:true,
cmargins: {top:0,bottom:2,right:2,left:2}
},
center: {
autoScroll:false
}
});
layout.beginUpdate();
layout.add('north', new YAHOO.ext.ContentPanel('header'));
layout.add('west', new YAHOO.ext.ContentPanel('tree-nav', {title: 'Qualifiants', fitToFrame:true}));
innerLayout = new YAHOO.ext.BorderLayout('content', {
south: {
split:true,
initialSize: 500,
minSize: 100,
maxSize: 700,
autoScroll:true,
collapsible:true,
//titlebar: true,
animate: true,
tabPosition: 'top',
closeOnTab: true,
cmargins: {top:2,bottom:0,right:0,left:0}
},
center: {
titlebar: true,
autoScroll:true
}
});
innerLayout.add('south', new YAHOO.ext.ContentPanel('detail-view', {title: "Détail", closable:false}));
innerLayout.add('center',new YAHOO.ext.ContentPanel('list-view', {title: "Tralala"}));
layout.add('center', new YAHOO.ext.NestedLayoutPanel(innerLayout));
layout.restoreState();
layout.endUpdate();
The center region contains a grid, and when i click on a row i would like to create a new panel / tab in the south region.
Here my code for the onclick event:
var southLayoutReg = innerLayout.getRegion('south');
if( southLayoutReg.hasPanel(id) ){
southLayoutReg.showPanel(id);
}else{
var detailView = window.document.getElementById("detail-view");
ldiv = YAHOO.ext.DomHelper.append(detailView, {tag: 'div', id: id});
innerLayout.add( 'south', new YAHOO.ext.ContentPanel(ldiv, {
title: label,
fitToFrame:true,
closable: true
})
);
}
This code runs well but there is always the tab "détail" before the others.
It is possible to create the south region in the innerLayout, without to define a default content panel ?
Thanks for answers.
I had created a BorderLayout like this:
layout = new YAHOO.ext.BorderLayout(document.body, {
hideOnLayout: true,
north: {
split:false,
initialSize: 25,
titlebar: false
},
west: {
split:true,
initialSize: 200,
minSize: 175,
maxSize: 400,
titlebar: true,
collapsible: true,
animate: true,
autoScroll:true,
useShim:true,
cmargins: {top:0,bottom:2,right:2,left:2}
},
center: {
autoScroll:false
}
});
layout.beginUpdate();
layout.add('north', new YAHOO.ext.ContentPanel('header'));
layout.add('west', new YAHOO.ext.ContentPanel('tree-nav', {title: 'Qualifiants', fitToFrame:true}));
innerLayout = new YAHOO.ext.BorderLayout('content', {
south: {
split:true,
initialSize: 500,
minSize: 100,
maxSize: 700,
autoScroll:true,
collapsible:true,
//titlebar: true,
animate: true,
tabPosition: 'top',
closeOnTab: true,
cmargins: {top:2,bottom:0,right:0,left:0}
},
center: {
titlebar: true,
autoScroll:true
}
});
innerLayout.add('south', new YAHOO.ext.ContentPanel('detail-view', {title: "Détail", closable:false}));
innerLayout.add('center',new YAHOO.ext.ContentPanel('list-view', {title: "Tralala"}));
layout.add('center', new YAHOO.ext.NestedLayoutPanel(innerLayout));
layout.restoreState();
layout.endUpdate();
The center region contains a grid, and when i click on a row i would like to create a new panel / tab in the south region.
Here my code for the onclick event:
var southLayoutReg = innerLayout.getRegion('south');
if( southLayoutReg.hasPanel(id) ){
southLayoutReg.showPanel(id);
}else{
var detailView = window.document.getElementById("detail-view");
ldiv = YAHOO.ext.DomHelper.append(detailView, {tag: 'div', id: id});
innerLayout.add( 'south', new YAHOO.ext.ContentPanel(ldiv, {
title: label,
fitToFrame:true,
closable: true
})
);
}
This code runs well but there is always the tab "détail" before the others.
It is possible to create the south region in the innerLayout, without to define a default content panel ?
Thanks for answers.