prajwalkman / angular-slider

(DEPRECATED) Slider directive implementation for AngularJS, without jQuery dependencies
http://prajwalkman.github.io/angular-slider
MIT License
249 stars 177 forks source link

Set Max range dynamically. #34

Open milindrasal opened 10 years ago

milindrasal commented 10 years ago

I need to set max range dynamically. I am using slider five times in a page to filter table data. Data is coming from json and slider is working fine. I need to set the max range dynamically.

I have added static values in ceiling like this "ceiling="1000" and also set "upper_Range = 1000" in js file. I am trying to add these values dynamically so if the data having value in between 10 then max value need to be 10 and if data having value in between 100 then max value need to 100.

How can I do this. Please suggest.

pshaver commented 10 years ago

I would also like the ability to do this. If I have a list of products ranging from $2.99 - $29.99, that is what I would like my floor and ceiling to be. Perhaps there is a way to do this already?

cjmling commented 10 years ago

me too, i want to able to set "floor" and "ceiling" from defined variable... it doesn't seems to work now :(

cjmling commented 10 years ago

Look at this answer , he edited the main angular-slider.js file to able to add "custom-floor" and "custom-ceiling" for that http://stackoverflow.com/a/19247832/507203

pshaver commented 10 years ago

Thanks cjmling, Unfortunately that example is for a single item and not from a result set. It would certainly work though otherwise.

cjmling commented 10 years ago

@pshaver by "result set" do you mean to loop through result set in ng-repeat?

if yes, look at small fixes at this http://plnkr.co/edit/oz3MPcoKVDuyqGDR0yR3?p=preview

I later then mange to merge that custom-floor with custom-ceiling for my project uses(not included in plnkr above), which works like a charm for me now.

Hope it helps