PDA

View Full Version : Form styles not working?



Brendan
2 Nov 2011, 3:20 PM
Hi all, I have the following code, which for some reason is ignoring any styles I set, i.e bodyBorder, BodyStyle and bodyPadding, what is going on?


var ReportForm = new Ext.form.FormPanel({
renderTo: 'ReportForm',
title: 'Search Criteria:',
width: 230,
bodyPadding: 10,
bodyBorder: 10,
layout: 'anchor',
defaults: {
anchor: '100%'
},
bodyStyle:'background-color:#fff;padding: 10px',
items: [
{ xtype: 'datefield', fieldLabel: 'From', name: 'StartDate', value: SevenDaysAgo, labelAlign:'right'},
{ xtype: 'datefield', fieldLabel: 'To', name: 'EndDate', value: today, labelAlign:'right'},
{ xtype: 'textfield', fieldLabel: 'Account #', name: 'Acc_Code', value: '', labelAlign:'right'},
{ xtype: 'checkbox', fieldLabel: 'Include: No Acc', name: 'Blank_Acc_Code', checked: true, labelAlign:'right'},
{ xtype: 'checkbox', fieldLabel: 'No Desc', name: 'Blank_Prob', checked: true, labelAlign:'right'}
],
buttonAlign: 'left',
buttons:[{name: 'Generate', text: 'Generate',
handler: function() {
var s_dt = ReportForm.getForm().findField("StartDate").getValue();
var e_dt = ReportForm.getForm().findField("EndDate").getValue();
if ((s_dt != null) && (e_dt != null)) ReportStore.load({params:{Start_Date: s_dt.format("yyyy-mm-dd"),
End_Date: e_dt.format("yyyy-mm-dd"),
Acc_Code: ReportForm.getForm().findField("Acc_Code").getValue(),
BAC: ReportForm.getForm().findField("Blank_Acc_Code").getValue(),
BP: ReportForm.getForm().findField("Blank_Prob").getValue()
}});
else alert('Please enter valid dates');
}
}]
});

Brendan
2 Nov 2011, 3:29 PM
It's ok, I worked out that you also need to have:

frame: true,

Doh...