-
8 May 2012 7:03 AM #1
Ext.form.field.Time does not initialize value correctly
Ext.form.field.Time does not initialize value correctly
Ext version tested:
- Ext 4.1
- all
- n/a
- Ext.form.fieldTime does not initialize a non-empty value correctly, so that it will always be marked as dirty, allthough it might not have been changed.
- see Test case
- see Test case
- see Test case
Code:var f=Ext.create('Ext.form.Panel', { title: 'Time Card', width: 300, bodyPadding: 10, renderTo: Ext.getBody(), items: [{ xtype: 'timefield', name: 'in', fieldLabel: 'Time In', minValue: '6:00 AM', maxValue: '8:00 PM', increment: 30, anchor: '100%', value:'11:00 AM' }] }); console.log(f.items.first().isDirty())
HELPFUL INFORMATION
Screenshot or Video:- none
- yes
A possible fix is borrowed from the datefield, using the initValue function for the timefield too:
Additional CSS used:Code:Ext.override(Ext.form.field.Time, { initValue : function() { var me = this, value = me.value; // If a String value was supplied, try to convert it to a proper Date if (Ext.isString(value)) { me.value = me.rawToValue(value); } me.callParent(); } });- n/a
- all
-
9 May 2012 9:14 AM #2
Thank you for the report. It should behave as setRawValue
Regards,
Scott.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-6160
in
4.1.


Reply With Quote