On change event Ext.form.DateField

放肆的年华 提交于 2019-12-11 02:26:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!