Results 1 to 6 of 6

Thread: [ext 1 b1] DateField don't fire onchange event

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    89
    Vote Rating
    0
      0  

    Default [ext 1 b1] DateField don't fire onchange event

    After choosing date form calendar date field don't fire onchange event. It fires only if you type date directly in the field.

    Is that a bug? Is important for me to detect any change done on date fields, there is another way to hanlde it?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956
    Vote Rating
    20
      0  

    Default

    It fires on blur similar to the browsers own change event. Is this not the behavior you are seeing?
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    89
    Vote Rating
    0
      0  

    Default

    Yes, I'm using it, but what I need to know is if any change has been made, not if someone has "activated" the field, cause it doesn't mean that the value has changed.
    Actually, I'm using both onchange and onblur event, to handle both user direct typing and calendar activation. But in the second case I don't really know if any change has taken place.

    It should be good if in the onblur event datefield detects if changes has been made and fires the onchange event. Is it possible?

    I remember some strange behaviours beetwen FF and IE about those 2 events. Something like that FF fires blur befor change and IE fires change before blur or the contrary, maybe this thing make difficoult to handle this situation?!

    Bye

  4. #4
    Ext User heidtmare's Avatar
    Join Date
    Mar 2007
    Location
    The Space Coast, FL
    Posts
    307
    Vote Rating
    0
      0  

    Default

    maybe you could onActivate store the contents, and then onBlur you could compare the new with the original and then fire the onChange function you wanted to call. Just a thought.
    I like it. Simple, easy to remember.
    ...but why is the rum gone?

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    89
    Vote Rating
    0
      0  

    Default

    I haven't found an OnActivate event, but ts should be a good workaround.
    There is a triggerClick event, I think comparable with onActivate, but for what I understand need to create a class that extend dateField to override the function that handle it.
    I'm not a js expert, maybe there is another way than extend the class. I need to do some expertiment.


  6. #6
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956
    Vote Rating
    20
      0  

    Default

    Try this and let me know if it works for you:
    Code:
    Ext.form.DateField.prototype.menuListeners.show = function(){
        this.onFocus();
    }
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •