var startdt = Ext.create('Ext.form.DateField',{
fieldLabel: 'Start Date',
name: 'startdt',
id: 'startdt',
vtype: 'daterange',
format: 'd/m/Y',
endDateField: 'enddt', // id of the end date field
value = new date()
})
var enddt = Ext.create('Ext.form.DateField',{
fieldLabel: 'End Date',
name: 'enddt',
id: 'enddt',
format: 'd/m/Y',
vtype: 'daterange',
startDateField: 'startdt', // id of the start date field
value = new date()
})
this kind of method will let the window unable to show in center correctly. any idea to let the datefield set the default value with out using this method?
this is an bug from extjs 4,u can try this following code
var startdt = Ext.create('Ext.form.DateField',{
fieldLabel: 'Start Date',
name: 'startdt',
id: 'startdt',
vtype: 'daterange',
format: 'd/m/Y',
endDateField: 'enddt', // id of the end date field
listeners : {
render : function(datefield) {
/// code to convert GMT String to date object
datefield.setValue(new Date());
}
}
})
var enddt = Ext.create('Ext.form.DateField',{
fieldLabel: 'End Date',
name: 'enddt',
id: 'enddt',
format: 'd/m/Y',
vtype: 'daterange',
startDateField: 'startdt', // id of the start date field
listeners : {
render : function(datefield) {
/// code to convert GMT String to date object
datefield.setValue(new Date());
}
}
})