1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    18
    Vote Rating
    0
    venkateshwar is on a distinguished road

      0  

    Default 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.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,684
    Vote Rating
    435
    Answers
    3111
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    18
    Vote Rating
    0
    venkateshwar is on a distinguished road

      0  

    Default


    @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]