Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3004 closed bug (fixed)

Change slider options from range to single value on the fly

Reported by: Kyle Owned by: paul
Priority: major Milestone: 1.5.1
Component: ui.slider Version: 1.5
Keywords: slider, range Cc:
Blocked by: Blocking:

Description

I am trying to use the slider in two, exclusive ways. In one instance, I want a range of values to search for. In the other instance, I want to search for a single value. I want one slider to do this and to use a checkbox to toggle range:true and range:false.

This is my attempt to change an already-set slider that functions perfectly.

$("input[name=rangeLSAT]").bind("click",function(){

if($(this).attr("checked")){

Now it's checked

} else{

Now it's unchecked $("#LSAT_Slider").slider({

range: false, slide: function(e,ui) {

alert("Hi");

}

});

}

It produces the following error:

d.split is not a function e(Object range=false, undefined)jquery-1.2.6.pack... (line 11) (no name)()0708 (line 67) e(Object originalEvent=Event click which=1 view=window)jquery-1.2.6.pack... (line 11) e()

The initial initiation of the slider works flawlessly.

Change History (3)

comment:1 Changed 15 years ago by Kyle

Oops, I posted the wrong error.

The correct error is:

C.data("mouse") has no properties e(undefined, "x")jquery-ui-1.5-sli... (line 1) e(Object originalEvent=Event mousedown which=1 view=window, div#LSAT2.ui-slider-handle)jquery-ui-1.5-sli... (line 1) e(Object originalEvent=Event mousedown which=1 view=window)jquery-ui-1.5-sli... (line 1) e(Object originalEvent=Event mousemove which=1 view=window)jquery-ui-1.5-sli... (line 1) e(Object originalEvent=Event mousemove which=1 view=window)jquery-ui-1.5-sli... (line 1) e(Object originalEvent=Event mousemove which=1 view=window)jquery-1.2.6.pack... (line 11) e()

This error occurs only after I click the checkbox, instantiating the slider option change, when I try to drag one of the handles.

comment:2 Changed 15 years ago by paul

Resolution: fixed
Status: newclosed

Hey there, you are doing it the wrong way, but non-the-less, it needed some implementation. In the lastest revision (or 1.5.1), you can now do

$(..).data("range.slider", false)

to disable the slider option for the selected slider (same with later enabling it again).

comment:3 Changed 15 years ago by paul

Milestone: 1.5.1
Version: 1.5b41.5
Note: See TracTickets for help on using tickets.