PDA

View Full Version : window size using getHeight



h3ll0w
18 Oct 2009, 10:30 PM
Hellow this is my code:




function setupPanels() {
function saveState(e) {
toggleMaximize: true
cp.set(e.contentEl, e.collapsed);
var H = Ext.get('getH').getHeight();
window.resizeTo(400, 60+H);
}
var Panel = Ext.extend(Ext.Panel, {
toggleMaximize: true,
collapsible: true,
animCollapse: false,
renderTo: 'panels',
style: 'margin-bottom:1em;',
bodyStyle: 'padding:4px;',
listeners: { 'collapse': saveState, 'expand': saveState }
});
var cEl = 'customerFields';
new Panel({
toggleMaximize: true,
id: 'customerFieldsId',
title: 'Abonents',
contentEl: cEl,
collapsed: cp.get(cEl, false)
});
var cEl = 'addressFields';
new Panel({
toggleMaximize: true,
title: 'Adrese',
contentEl: cEl,
collapsed: cp.get(cEl, false)
});
var cEl = 'detailsFields';
new Panel({
toggleMaximize: true,
title: 'Rekviz?ti',
contentEl: cEl,
collapsed: cp.get(cEl, true)
});
var cEl = 'deviceFields';
new Panel({
toggleMaximize: true,
title: 'Ier?ce',
contentEl: cEl,
collapsed: cp.get(cEl, true)
});
}


I have this elements. I can hide theim and open visible. The problem is I wanna resize window that I don't needed to scroll the window down. I have make that it's work but not for 100%. The size is loading first and than other size is putting in first and the window size is incorrect. I just wanna ask where can I put this code:
var H = Ext.get('getH').getHeight();window.resizeTo(400, 60+H);
That it loads last and resize my window in propable size.
Please help.

h3ll0w
18 Oct 2009, 10:56 PM
I sold out the problem. Just putted in and of code the same code that copy/past.