Skip to content Skip to sidebar Skip to footer

Add Tip Text Dynamically To A Slider

In my project, I am trying to add the tip text (config) dynamically to a slider. How to do that? I need to add it dynamically because I am generating the array of variables in a '

Solution 1:

tipText requires a function config so you can add a function that will use your variables from controller;

Ext.create('Ext.slider.Multi', {
    ....
     tipText: function(){
          return App.getController('your controller').yourVariable
     },
    .....
});

This is added on the creation of the slider so you don't need to modify it , just your variables in controller. So you don't need to re set the tip text function.

Solution 2:

I solved this issue by using getText method of Ext.slider.Tip.

Used to create the text that appears in the Tip's body. By default this just returns the value of the Slider Thumb that the Tip is attached to. Override to customize.

For example in which situation it can be used, you have a look at this link

Post a Comment for "Add Tip Text Dynamically To A Slider"