date field from auto field does not fire change event

122 views
Skip to first unread message

mauro larese

unread,
Apr 3, 2014, 1:15:20 PM4/3/14
to gl...@googlegroups.com
I my saviors :) (time saviors i mean)
Another small question.
When i write a date in a datefield  instead of select it from the date picker, the 'change' event does not fire;
Any help?

- Mauro

Ryan Smith

unread,
Apr 3, 2014, 1:21:15 PM4/3/14
to gl...@googlegroups.com
Does the event fire when you blur the control?  Meaning when you go to another control or click off the field?

-Ryan


--
You received this message because you are subscribed to the Google Groups "GluJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glujs+un...@googlegroups.com.
To post to this group, send email to gl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glujs/70c011d5-376d-4d42-b847-f53ed85cacc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mauro larese

unread,
Apr 3, 2014, 1:24:35 PM4/3/14
to gl...@googlegroups.com

mauro larese

unread,
Apr 3, 2014, 1:25:49 PM4/3/14
to gl...@googlegroups.com
it is like change event is not binded by glujs

Ryan Smith

unread,
Apr 3, 2014, 1:31:23 PM4/3/14
to gl...@googlegroups.com
So... I see the problem you are having.  My guess though is that extjs isn't actually firing the change event, because if it were then you'd be getting the event just like you are from the picker (which does listen to the change event).  This is a guess, but try setting enableKeyEvents: true on the datefield.  Its defaulted to false according to the extjs docs, so changing it to true might fire the proper events on keydown and all that that glujs can listen to.  Hopefully that helps!

-Ryan


mauro larese

unread,
Apr 3, 2014, 1:49:09 PM4/3/14
to gl...@googlegroups.com

mauro larese

unread,
Apr 3, 2014, 1:50:14 PM4/3/14
to gl...@googlegroups.com
how can i add a change event tha glu can listen?

Ryan Smith

unread,
Apr 3, 2014, 1:52:31 PM4/3/14
to gl...@googlegroups.com
I was hoping that would have just worked naturally, but since it isn't this should manually fire the change event whenever the keyup event is fired from the control.  Hope this helps!

{
    xtype: 'datefield',
    enableKeyEvents: true,
    listeners: {
        keyup: function(field){field.fireEvent('change', field)}
    }
}


-Ryan


mauro larese

unread,
Apr 3, 2014, 2:07:26 PM4/3/14
to gl...@googlegroups.com
I TRIED IT BUT I THINK THE PROBLEM IS ANOTHER ONE.
(sorry for capitals)
when i press a key the change event fire but glujs does not react;
when i pick the date it does


Ryan Smith

unread,
Apr 3, 2014, 4:06:44 PM4/3/14
to gl...@googlegroups.com
Sorry about the bad advice before, I was going off of memory.  I just tested the date control and this works:

{
xtype: 'datefield',
name: 'date',
enableKeyEvents: true,
listeners: {
keyup: function(field) {
field.fireEvent('select', field, field.getValue())
}
}
}

I'm not sure that you really want to do this, but this will cause the event to fire and glujs to get the change.  Hope that helps!

-Ryan


mauro larese

unread,
Apr 3, 2014, 4:25:00 PM4/3/14
to gl...@googlegroups.com
HEHE i was posting my own
                       change: function(fld,value){ 
                            fld.fireEvent('select', fld,value)
                        }


mauro larese

unread,
Apr 3, 2014, 4:26:16 PM4/3/14
to gl...@googlegroups.com
anyway thank you very much ...
this is what i need
- Mauro
Reply all
Reply to author
Forward
0 new messages