PDA

View Full Version : [Solved] Form Field... some bugs



babsevensix
8 Aug 2007, 5:08 AM
I've made a formfield with this code:
[CODE]
formDettagli = new Ext.form.Form({
labelAlign: 'right',
labelWidth: 100,
buttonAlign: 'right',
url:'DettaglioRegata.ashx',
baseParams:{idGara:idGara},
// configure how to read the XML Data
reader : myreader/*,
// reusable eror reader class defined at the end of this file
errorReader: new Ext.form.XmlErrorReader()*/
});

formDettagli.fieldset(
{legend:'Dettagli'},
new Ext.form.Field({
fieldLabel: 'Nome regata',
name: 'nomeregata',
width:175,
allowBlank:false,
readOnly : true
}),
new Ext.form.DateField({
fieldLabel: 'Data',
name: 'dataFormatted',
/*disabled : true,
disableClass : '',*/
format:'d/m/Y',
width:100,
allowBlank:false,
readOnly : true
}),
new Ext.form.Field({
fieldLabel: 'Ora',
name: 'ora',
width:75,
allowBlank:false,
readOnly : true
}),
new Ext.form.Field({
fieldLabel: 'Modalit

jack.slocum
8 Aug 2007, 9:22 AM
From the Docs:

"* @cfg {Boolean} readOnly True to mark the field as readOnly in HTML (defaults to false) -- Note: this only sets the element's readOnly DOM attribute."

As noted, this doesn't do anything more than set the readOnly attribute on the input field. If you want to disable it completely, set it to disabled:true.

babsevensix
9 Aug 2007, 11:00 AM
If I disable the datefield is different thant readonly.
With a readonly field user can copy value, not with disabled field (with Iternet Explorer)

mystix
10 Aug 2007, 8:17 AM
this isn't a bug.

readOnly works on the DateField, not the DateField's DatePicker.

there's a perfectly valid use case for this behaviour:
preventing user input via typing, and only allowing date selection via the DateField's DatePicker.

if you're looking to disable the DatePicker as well when a DateField is in readOnly mode, you'll have to do it manually.

babsevensix
16 Aug 2007, 3:02 AM
Ok, thanks for reply