PDA

View Full Version : How to set the width and height of a window based on browsers in Extjs



dev_java
15 Oct 2010, 11:26 PM
Hi,

I am using Extjs 3.0. I have a scenario like when i click on a button , i should show the details of the row selected in a new window. I am using field sets to display the data in the window. I have specified the height and width of window. This works fine in firefox and google chrome. Where as in internet explorer, the window is giving empty spaces after the field set, both height wise and width wise. If i try to reduce the height & width , its affecting the screens in other browsers(firefox & chrome). How can i make these credentials browser compatible?




gridDetails= Ext.extend(Ext.FormPanel,
{
frame:true,
headerAsText : true,
border:false,
buttons: [
{
text:'Ok',
handler: function(){

}
},
{
text:'Cancel',
handler: function(){

}
}
],
buttonAlign:'center',
initComponent: function()
{

Ext.apply(this,
{
items: [gridDetailsPanel,gridSourceDetailsPanel]
});
alarmDetails.superclass.initComponent.call(this);

}
}
);
Ext.reg('gridDetails', gridDetails);

var w = new Ext.Window({
title: 'Details',
closable:false,
id:'details',
width:600,
height:545,
plain:true,
modal:true,
layout: 'fit',
items:[new gridDetails()]
})


w.show();

});


In the above code , gridDetailsPanel and gridSourceDetailsPanel are fieldset which is assigned to a panel, gridDetails.

Can anyone suggest me a solution for this?

Thanks

Animal
15 Oct 2010, 11:32 PM
Well HOW do you want those two to e sized and arranged?

This is because YOU must specify a layout in the gridDetails.

dev_java
16 Oct 2010, 12:07 AM
When i use IE, before to the Ok and cancel button , i am getting some empty space. I want to omit this empty space. I feel in IE, the spacing between the fieldset and data in the fielset is less.

Animal
16 Oct 2010, 12:17 AM
You must specify a layout to tell the gridDetails panel HOW to size and arrange its children.

It's part of your design. Work out WHAT you want it to do first.

WHAT do you want it to do?