Sencha Premium Member
Answered: Is there any reason why Slider only supports Integer?
I figured it would be best to ask if there was any reason for this choice before I tried to roll my own SliderCell which extends FieldCell<Number> (or similar).
After quickly looking at the current SliderCell implementation, it looks like it **might** be straight forward.
Posted by Colin Alworth
The main reason is probably to do with building the behavior is the doSnap method and keyboard control - without that, the functionality is nearly the same - continuous values (or nearly so).
It could (and perhaps should) have been implemented like SpinnerField, with the ability to support either type of Number, and extra configuration options to manage the step sizes.
As it would be an API-breaking change, the earliest it could be done would be 3.1.0 - we have a few other changes that would need to be made more generic that this would go nicely with. The one concern I have is that it would break existing code using SliderField as a editor in a form if we change it to SliderField<N extends Number> - for this reason we might have to add a superclass, AbstractSliderCell<N>, and make SliderField and a new DoubleSliderField extend that.
Tags for this Thread