PDA

View Full Version : how do we specify our own intervals on Extjs sliders



ravimaroju
22 Jan 2013, 5:46 AM
Hi,

i have some requirement where i want to specify our own intervals for
Extjs single slider.

i, e , I want to define a slider with some values like (Jan, Feb, Mar, April, May etc...) instead of integer values(1,2,3,4,5,6,7,8 etc......).

while user moves the slider , it has to display the " tipText " property value with Month Names instead of number .

any suggestions would be appreciated..
thanks

friend
22 Jan 2013, 8:05 AM
You'll need to perform some serious brain surgery on Ext.slider.Multi (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.slider.Multi). Have a look at the source (http://docs.sencha.com/ext-js/4-1/source/Multi.html#Ext-slider-Multi).

slemmon
22 Jan 2013, 11:53 AM
Like this?



Ext.create('Ext.slider.Single', {
width: 200,
value: 1,
increment: 1,
minValue: 1,
maxValue: 12,
renderTo: Ext.getBody()
, months: {
1: 'Jan'
, 2: 'Feb'
, 3: 'Mar'
, 4: 'Apr'
, 5: 'May'
, 6: 'Jun'
, 7: 'Jul'
, 8: 'Aug'
, 9: 'Sep'
, 10: 'Oct'
, 11: 'Nov'
, 12: 'Dec'
}
, tipText: function (thumb) {
return thumb.slider.months[thumb.slider.getValue()];
}
});

ravimaroju
22 Jan 2013, 8:52 PM
Thank You slemmon,,,


its working .....:-?