Results 1 to 7 of 7

Thread: [OPEN-979] Ext.form.SliderField -> Slider events

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,748
    Vote Rating
    128
      0  

    Default [OPEN-979] Ext.form.SliderField -> Slider events

    hi team,

    the Ext.form.SliderField does not listen to the changecomplete-event of the slider.
    the event "change" is still from the field, so it does not get changes when the slider is dragged and dropped.

    as a really fast written hack i use:

    Code:
    Ext.sequence(Ext.form.SliderField.prototype, 'setValue', function() {
    	this.fireEvent('change', this, this.getValue());
    });
    but it should get implemented cleander (returning the thumb etc.).


    kind regards,
    tobiu
    Best regards
    Tobias Uhlig

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,436
    Vote Rating
    859
      0  

    Default

    I'm not really clear on what you're saying here.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,748
    Vote Rating
    128
      0  

    Default

    hi evan,

    i would like to listen to the change-event of the sliderField, when a user changes the value via drag&drop. this is why i set up this small sequence-workaround -> the field never fires "blur" without an input-textfield.


    kind regards,
    tobias
    Best regards
    Tobias Uhlig

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2007
    Location
    Sydney
    Posts
    110
    Vote Rating
    17
      0  

    Default

    I'd just like to say that this 'fix' works perfectly for my application where I want to enable / disable some other fields depending on the slider value.

  5. #5
    Sencha User
    Join Date
    Jan 2011
    Posts
    2
    Vote Rating
    0
      0  

    Default Thank you

    This really works. Thank your for sharing it.

  6. #6
    Ext JS Premium Member
    Join Date
    Aug 2010
    Location
    Santa Clara, California
    Posts
    9
    Vote Rating
    0
      0  

    Default

    Thank you!!! This helped me a lot!!! Hopefully Sencha will fix this ...

  7. #7
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    38
    Vote Rating
    1
      0  

    Default

    Here's an improved version of the great fix by tobiu which calls the event handler with the proper arguments (slider, value, thumb), and also enables a "changecomplete" listener! The changecomplete event is more useful if for instance you want to post the updated value instantly by Ajax (you don't want to do that while the user is still sliding as that could potentially trigger hundreds of requests).

    Code:
    Ext.sequence( Ext.form.SliderField.prototype, 'initComponent', function() {
    	this.slider.on( 'change', this.fireEvent.createDelegate( this, 'change', 0 ) );
    	this.slider.on( 'changecomplete', this.fireEvent.createDelegate( this, 'changecomplete', 0 ) );
    });
    @Sencha: I also agree that it would make a lot more sense if the SliderField would just relay the Slider's events like change and changecomplete!

Posting Permissions

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