PDA

View Full Version : [OPEN-979] Ext.form.SliderField -> Slider events



tobiu
19 May 2010, 1:22 AM
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:



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

evant
1 Jun 2010, 6:01 AM
I'm not really clear on what you're saying here.

tobiu
1 Jun 2010, 7:10 AM
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

CaCtus491
1 Jan 2011, 5:51 AM
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.

ta4ka
28 Feb 2011, 1:46 AM
This really works. Thank your for sharing it.

nikolai.efimov
18 Mar 2011, 10:59 AM
Thank you!!! This helped me a lot!!! Hopefully Sencha will fix this ...

rijkvanwel
30 Mar 2011, 2:58 AM
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).



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!