PDA

View Full Version : columa help



mic2100
3 Mar 2010, 5:27 AM
Hi,

I have been building a popup div that contains various fields for users to fill in, the window appears but only has 2 large textboxes at the top and doesn't show things as it should do.



var sector_combo = new Ext.form.ComboBox({
store: sector_combo_store,
typeAhead: true,
mode: 'local',
forceSelection: false,
triggerAction: 'all',
fieldLabel: 'Company Sector',
emptyText:'Select a sector...',
selectOnFocus:true,
name: 'comp_sector',
id: 'comp_sector'
});

var form_fields = new Ext.FormPanel({
labelWidth: 100, // label settings here cascade unless overridden
labelAlign: 'top',
frame:true,
bodyStyle:'padding:5px 5px 0',
width: 600,
layout:"column",
defaults: {width: 230},
autoScroll: true,
defaultType: 'textfield',
items: [{
columnWidth:0.5,
defaults: {width: 230},
items:
[{
fieldLabel: 'Company Name',
name: 'comp_name',
id: 'comp_name',
value: "Comapnay Name",
allowBlank:false
},sector_combo]
},{
columnWidth:0.5,
defaults: {width: 230},
items:
[{
fieldLabel: 'Address Line 1',
value: "Address Line 1",
name: 'ad1',
id: 'ad1',
allowBlank:false
},{
fieldLabel: 'Address Line 2',
value: "Address Line 2",
name: 'ad2',
id: 'ad2'
},{
fieldLabel: 'City',
value: "City",
name: 'city',
id: 'city',
allowBlank:false
},{
fieldLabel: 'County',
value: "County",
name: 'county',
id: 'county',
allowBlank:false
},{
fieldLabel: 'Postcode',
value: "Postcode",
name: 'postcode',
id: 'postcode',
allowBlank:false
},{
fieldLabel: 'Country',
value: "Country",
name: 'country',
id: 'country'
}]
}]
});



win = new Ext.Window({
applyTo:'add_new_company_win',
layout:'fit',
width:900,
height:400,
closeAction:'hide',
title: 'Add New Company',
items: [form_fields],
buttons: [{
text:'Submit',
handler: function(){
Ext.Msg.alert("Form Submitted", "Form Submitted");
}
},{
text: 'Close',
handler: function(){
win.hide();
}
}]
});
i am a little confused about this becuase i have done this a few times b4 and neva had a problem like this. Im guessing its sumthing stupid but when u are looking at code for a long time it all starts to look the same.

Thanks

Mic