PDA

View Full Version : pseudo-visible window.buttons if window.width='auto'



johnrembo
19 May 2010, 7:21 AM
Hi,

I'm not sure if this is a bug


var w=new Ext.Window({
id:'login-window',
title:'Login',
layout:'form',
labelWidth:60,
buttonAlign:'right',
padding:5,
width:'auto',
height:'auto',
buttons: [{text: 'Ok'},{text: 'Cancel'}],
items:new Ext.form.TextField({fieldLabel:'name',width:120}),
}).show();

and here's the result
http://img408.imageshack.us/img408/2320/bugnx.jpg

ps: resizing window corrects the issue
ps2: window title seems to be realted to revealed button area width (try changing title to i.e. "")

any solutions?

evant
19 May 2010, 7:25 AM
Not a bug, you need to give the window dimensions.

johnrembo
19 May 2010, 7:44 AM
nope - that's not true

after pissing for a while trying to unsuccessfuly perform w.getForm() a clear solution came:


var fp=new Ext.FormPanel({
labelWidth:60,
buttonAlign:'center',
padding:5,
items:new Ext.form.TextField({fieldLabel:'name',width:120})
});

var w=new Ext.Window({
id:'login-window',
title:'Login',
items:fp,
buttons: [{text: 'Ok'},{text: 'Cancel'}]
}).show();