PDA

View Full Version : Strange issue with DateField



gj.gauravjain
1 Feb 2014, 7:38 AM
Hi,

I am using 4.2. I have a form to which I add fields dynamically. The application is internationalized to work in English and German.

In English datefields work perfectly.
In German, strangely, the saved value doesn't populate ! Even when I hardcode them !! See the code below-

Any ideas please?



var field = {xtype: 'datefield',
fieldLabel: fieldLabelVal,
forcePrecision : forcePrecisionVal,
allowBlank: allowBlankVal,
name: columnNameVal,
decimalPrecision: decimalPrecisionVal,
validateOnBlur : true,
value: '01/02/00',
maxLength : maxLengthVal
}

form.add(field);

gj.gauravjain
1 Feb 2014, 9:57 AM
I got past the problem by specifying a format and also changing the format of value I was feeding. Still don't understand why the behavior was different when I login to the application selecting language as 'German'. Got to be one of the Ext-lang* files, I guess.



var field = {xtype: 'datefield',
fieldLabel: 'fieldLabelVal',
forcePrecision : forcePrecisionVal,
allowBlank: allowBlankVal,
name: columnNameVal,
format: 'm-d-Y',
decimalPrecision: decimalPrecisionVal,
validateOnBlur : true,
value: '01-02-2001',
maxLength : maxLengthVal
}