问题
I have a Ext.form.DateField:
new Ext.form.DateField({
id: 'date_from',
format: 'd/m/Y',
editable: false,
listeners: {
change: function (t,n,o) {
console.log('dsd');
}
}
})
However unfortunately the change event does not seem to be executed.
I have also tried:
new Ext.form.DateField({
id: 'date_from',
format: 'd/m/Y',
editable: false,
change: function (t,n,o) {
console.log('dsd');
}
})
However also to no avail. Any advice appreciated.
Thanks
回答1:
The change event only fires on blur. If you are trying to handle any date selection use the select event instead (in ExtJS 3.4).
回答2:
And the first way is the correct way to add listeners.
回答3:
you can change it into :
new Ext.form.DateField({
id: 'date_from',
format: 'd/m/Y',
editable: false,
listeners: {
update: {
fn:function(){
console.log('dsd');
}
}
}
})
来源:https://stackoverflow.com/questions/3247948/on-change-event-ext-form-datefield