-
23 Feb 2012 8:19 PM #1
Answered: Slider event when setValues or setRecord is used?
Answered: Slider event when setValues or setRecord is used?
Is there any event fired when slider value is changed using setValues or setRecord
change, updatedata events were not firing?
-
Best Answer Posted by mitchellsimoens
No but with this override you can get the change event working when you do a setValue on the field:
You would have to try the setValues and setRecord on the form but it should still work.Code:Ext.define('Override.slider.Slider', { override : 'Ext.slider.Slider', updateValue : function(newValue, oldValue) { this.callOverridden([newValue, oldValue]); var changed = false, v = 0, vNum = newValue.length; if (oldValue) { for (; v < vNum; v++) { if (newValue[v] !== oldValue[v]) { changed = true; break; } } } if (changed) { this.fireEvent('change', this, newValue, oldValue); } } });
-
24 Feb 2012 8:25 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
No but with this override you can get the change event working when you do a setValue on the field:
You would have to try the setValues and setRecord on the form but it should still work.Code:Ext.define('Override.slider.Slider', { override : 'Ext.slider.Slider', updateValue : function(newValue, oldValue) { this.callOverridden([newValue, oldValue]); var changed = false, v = 0, vNum = newValue.length; if (oldValue) { for (; v < vNum; v++) { if (newValue[v] !== oldValue[v]) { changed = true; break; } } } if (changed) { this.fireEvent('change', this, newValue, oldValue); } } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
24 Feb 2012 9:39 AM #3
Hi Mitchel,
Thanks for the help, works fine. I was trying to figure out how to override and here it is
.
It will be nice to have document on extending a component.


Reply With Quote