Bug Tracker

Ticket #2499 (reopened enhancement)

Opened 9 months ago

Last modified 9 months ago

UI Slider changing slider on the fly

Reported by: istvano Assigned to: joern
Type: enhancement Priority: major
Milestone: 1.2.4 Component: qunit
Version: 1.2.3 Keywords: ui slider
Cc: Needs: Review

Description

Hi Guys,

I have the situation when, based on an ajax request I need to change the slider range on the fly. The possible values the slider can select.

I am willing to write it, I just need some help how this should be implemented.

now, when the slider is created you have the min, max, steps

all I need is a function to change those values. also I do not know if I need to do anything else apart from changing the slider values, which can be done easily,

Thanks a lot,

Attachments

Change History

Changed 9 months ago by joern

  • status changed from new to closed
  • resolution set to worksforme

You can update all options on the fly using the data method. Its currently hard to find, due to lack of (public) documentation, but that'll be available soon: http://docs.jquery.com/UI/Guidelines#jQuery.data

To change the minValue option:

slider.data("minValue.slider", -10);

Changed 9 months ago by istvano

Thanks for that, :( I checked the code so the option, but I though there has to be some more code executed as the values are changing :)

Thanks again,

Changed 9 months ago by istvano

  • status changed from closed to reopened
  • resolution deleted

Hi,

I am still having problems with this functionality, it DOES not seem to work,

if I create a slider:

this._slider = $("#slider").slider({

startValue:0, minValue: 0, maxValue: 9, stepping: 1,

});

It creates the slider, and works fine, later in my code,

I do the following:

this._slider.data("stepping.slider", 1); this._slider.data("minValue.slider", 0); this._slider.data("maxValue.slider", 4);

It still have 9 steps and, even if I check it later on with a new call what does the data holds, gives me back min:0, max: 4, stepping:1, but still the slider itself has 9 steps etc.

Thanks for any help,

Istvan

Note: See TracTickets for help on using tickets.