It might be a silly question but I didn't find a way to get or set value of 'Ext.form.field.Date'
control. getValue()
returns null, setValue()
does nothing.
Where can be mistake?
var filterFrom = Ext.create('Ext.form.field.Date', {
xtype: 'datefield',
id: 'From',
name: 'From'
});
// ...
filterFrom.getValue(); // null
If declare change
listener for picker, it fires on setValue()
call, but nothing changes on UI.
filterFrom.setValue(new Date());
filterFrom.getValue();
> Date {Tue Feb 14 2012 00:00:00 GMT+0100}
filterFrom.setValue(new Date('December 19, 1989 03:24:00'));
filterFrom.getValue();
> Date {Tue Dec 19 1989 00:00:00 GMT+0100}
These work for me with your code (I just added a misssing )
after }
in line 5.