PDA

View Full Version : Ext Dependency Builder in Complex-Layout



humpdi
25 Apr 2007, 2:16 AM
hey guys!

i have a problem with building a toolbar in a complex-layout panel which includes the dependency builder - example over the full panel.
i will show it step by step for a better understanding of my problem:

html-code in my panel:



<div id='toolbar_genman'></div>
<div id='main-ct'></div>
ok, first i build the dependency-builder-example and append it to my complex-layout panel:


var GenManTree = function(){

return{

build : function(){

var xt = Ext.tree;
// seeds for the new node suffix
var cseed = 0, oseed = 0;
Ext.QuickTips.init();

var cview = Ext.DomHelper.append('main-ct',
{cn:[{id:'main-tb'},{id:'cbody'}]}
);


// create the primary toolbar
var tb = new Ext.Toolbar('main-tb');
tb.add({
id:'save',
text:'Save',
disabled:true,
handler:save,
cls:'x-btn-text-icon save',
tooltip:'Saves all components to the server'
});
// for enabling and disabling
var btns = tb.items.map;



// create our layout
var layout = new Ext.BorderLayout('panel_generalmanager', { //panel_generalmanager is my panel, where i append the layout of the dependency builder
west: {
split:true,
initialSize: 200,
minSize: 175,
maxSize: 400,
titlebar: true,
},
center: {
title:'My Organization',
}

});

now it looks like this:
http://www.cwc.at/pics/tree-toolbar1.jpg


then i create my toolbar and add it to the panel:


var GenManTree = function(){

return{

build : function(){

var xt = Ext.tree;
// seeds for the new node suffix
var cseed = 0, oseed = 0;
Ext.QuickTips.init();


var tb_genman = new Ext.Toolbar('toolbar_genman');
tb_genman.add({
id:'save',
text:'Save',
disabled:true,
handler:save,
cls:'x-btn-text-icon save',
tooltip:'Saves all components to the server'
});

var xview = Ext.DomHelper.append('main-ct',
{cn:[{id:'toolbar_genman'}]}
);


var cview = Ext.DomHelper.append('main-ct',
{cn:[{id:'main-tb'},{id:'cbody'}]}
);


// create the primary toolbar
var tb = new Ext.Toolbar('main-tb');
tb.add({
id:'save',
text:'Save',.....now it should look like this:

http://www.cwc.at/pics/tree-toolbar2.jpg


but it aint! the toolbar doesnt appear at the panel, it looks on like the first picture. no error, nothing, the toolbar add had no viewable effect!

what did i do wrong?

please help me to get the toolbar on the right place ;)

thanks, humpdi

chdavi
25 Apr 2007, 11:00 AM
humpdi,

I was having the same problem. Try setting the height of your toolbar div. Take a look at my post (http://extjs.com/forum/showthread.php?t=5295) for complete details.