PDA

View Full Version : Slider returns wrong value



mankz
5 Jun 2014, 5:39 PM
Slider returns wrong value. Works fine in Ext 4!

https://fiddle.sencha.com/#fiddle/6dp


Ext.application({
name : 'Fiddle',

launch : function() {
var sli = new Ext.slider.SingleSlider({
id : 'rowHeightSlider',
width : 200,
value : 40,
increment : 5,
minValue : 3,
maxValue : 100
})
console.log(sli.getValue()) // 38, expect 40. In Ext 4 it's 40
}
});

evant
5 Jun 2014, 7:09 PM
Out of curiousity, in what situation are the min/max not divisible by the increment?

mankz
5 Jun 2014, 7:15 PM
Probably they should be aligned yeah. But seems the slider 'respected' the value set in Ext 4?

evant
5 Jun 2014, 7:27 PM
Try configuring it with zeroBasedSnapping: true.