Results 1 to 8 of 8

Thread: Is there any reason why Slider only supports Integer?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    21
    Vote Rating
    0
      0  

    Default 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.

    Any thoughts?

  2. 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •