PDA

View Full Version : panel.doLayout() method is not working.



parth.suthar
7 Oct 2011, 4:11 AM
Hi Friend,
I got one problem, that I have a toolbar added as dockedItem in panel. But when i changed the dock property of toolbar,it is not reflected in screen instantaneously but when i resize the window it effects. I am doing panel.doLayout(),but it is not working.

My code is this,

var btn1 = new Ext.Button({
ui:'plain',
icon:'icons/White/home_white.png',
cls:'pressedCls-abc',
pressedCls:'pressedCls2',

handler:function(b,e){ alert("btn1 clicked");
toolbar.setLayout(new Ext.layout.VBoxLayout());
toolbar.setDocked('left',true);
panel.doLayout();
var evt = document.createEvent('UIEvents');
evt.initUIEvent('resize', true, false,window,0);
window.dispatchEvent(evt);
Ext.repaint();
},

});


var toolbar = new Ext.Toolbar({

layout:{type:'hbox',align:'top'},
width:'70px',
dock:'top',
draggable:true,
revert:true,

items:[
btn1,{
xtype:'button',
ui:'plain',
icon:'icons/White/home_white.png',
cls:'pressedCls-abc',
pressedCls:'pressedCls2',


}
]
});



var panel = new Ext.Panel({
fullscreen:true,
dockedItems:[
toolbar
]
});

}
});