-
4 Mar 2013 1:18 AM #1
Unanswered: Always show the tip text of Slider in Extjs
Unanswered: Always show the tip text of Slider in Extjs
How to keep the tip text of the slider always visible?
Currently, the tip text is being visible whenever the user drags the bar of the slider.
I searched on docs but couldn't find any related concepts.
-
5 Mar 2013 1:46 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
There isn't a config to do this. You can kind of do this but I'm not sure of any issues with other tips used in an app:
Code:Ext.define('Override.slider.Tip', { override : 'Ext.slider.Tip', init : function(slider) { var me = this; me.callParent([slider]); slider.on({ scope : me, single : true, delay : 100, //settle down DOM afterRender : me.onSliderRender }); slider.un({ scope : me, dragend : me.hide //this is what stops the tip from hiding }); }, onSliderRender : function(slider) { var thumbs = slider.thumbs, t = 0, tLen = thumbs.length, onSlide = this.onSlide; for (; t < tLen; t++) { onSlide(slider, null, thumbs[t]); } } }); Ext.create('Ext.slider.Single', { width : 200, value : 50, increment : 10, minValue : 0, maxValue : 100, renderTo : Ext.getBody() });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.
-
5 Mar 2013 8:23 PM #3
@mitchellsimoens This is working. Thanks. But actually, I am also moving the bar using two buttons which are adjacent to the slider ('<' and '>'). Your code works fine if I am only working with slider. But if I just press the adjacent buttons, the bar moves but not the tip text. Anyway to solve this too? [B]


Reply With Quote