Bug Tracker

Modify

Ticket #2502 (closed feature: fixed)

Opened 5 years ago

Last modified 15 months ago

ui.slider - Define ranges (min/max) for each handle

Reported by: joern Owned by: joern
Priority: major Milestone:
Component: ui Version:
Keywords: Cc:
Blocking: Blocked by:

Description

I need to define ranges for each handle, eg. handle one must be between 2 and 10, handle two between 5 and 100, where one must always be smaller then two. In other words: 2 < x <= 10, 5 < y <= 100, x < y.

Currently there is no way to restrict each handle.

Implementation notes:

There are several places where the restricition must be checked. Both the keydown and the click handler delegate to moveTo. So moveTo and drag, which handles the mouseinteraction, should check the range.

Specifying values could be done in the same fashion as for startValues (see #2053), eg.

$(...).slider({
  minValue: [2, 10],
  maxValue: [5, 100]
});

An alternative, grouping by handle:

$(...).slider({
  boundaries: [
    { min: 2, start: 5, max: 10 },
    { min: 10, start: 40, max: 100 }
  ]
});

Change History

comment:1 Changed 5 years ago by paul

  • Owner changed from paul to braeker

comment:2 Changed 5 years ago by joern

  • Owner changed from braeker to joern

comment:3 Changed 5 years ago by joern

  • Status changed from new to closed
  • Resolution set to fixed

Implemented in [5064].

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.