Search code examples
phpcodeigniterextjsextjs3

ExtJS 3.4 Slider Control


My question is releated to Extjs 3.4 Slider control. I want to get values i.e. min value and max value of two way slider on change event and dsiplay them in tag. But i cannot get two values for two different thumbs. In short i want get separate values of two thumbs. Here is my code

Ext.onReady(function(){
           var tip = new Ext.slider.Tip({
           getText: function(thumb){
               if(thumb)
               {
                  document.getElementById("lblAge").innerHTML= thumb.value;
               }


           }
       });

       new Ext.slider.MultiSlider({
           renderTo: 'ageslider',
           width   : 124,
           minValue: 0,
           maxValue: 100,
           values  : [0, 90],
           plugins : tip
              });

I am not able to figure out the solution,Please check the code. Thanks Inadvance.


Solution

  • there is a thumbs array in slider. You can make loop and get value for each thumb. Something similar:

    getText: function(thumb){
        var slider = thumb.slider;
        values = [];
        for (i = 0; i < slider.thumbs.length; i++) {
            values.push(slider.thumbs[i].value);
        }
        console.log(values);
    }