Hi all -

My earlier post about this today is not showing up, so I am reposting
now. Apologies if it's a repeat!

My question is basically how to manage many (up to 168) dynamically-
created sliders on a page. The idea is that the sliders are presented
on a form. The user sets the sliders and submits the form, which saves
the values of the sliders. On subsequent views, the sliders are set to
those saved values. The basic code is fairly short, so it's presented
inline below - this is all wrapped in the $(document).ready();
indexToValueArray maps indices to either default or the previously-
saved slider values:

for (i in indexToValueArray) {
   var sliderNameField = '#slider_name_' + i;
   var sliderValField = '#slider_val_' + i;
   var sliderDisplayValueField = '#slider_disp_val_' + i;
   $(sliderValField).val(indexToValueArray[i]);
   $(sliderDisplayValueField).text(indexToValueArray[i]);
   $('#slider_' + i).slider({
       handle: '#slider_handle_' + i,
       startValue: indexToValueArray[i],
       minValue: 0,
       maxValue: 10,
       steps: 10,
       slide: function(e, ui) {
           $(sliderValField).val(Math.round(ui.value / numSliders));
           $(sliderDisplayValueField).text(Math.round(ui.value /
numSliders));
       }
   });
}

Basically, the startValue is not honored for any of the sliders. I've
tried it with moveTo after the sliders are built, but that didn't seem
to work, either. Also, the $(sliderValField), which is used for form
submission, does not seem to be working exactly as intended. I'm not
sure, but it looks like the very last slider may be posting an
(incorrect) value to the server on form submit, but none of the
others.

Any insight would be appreciated!

- Tim

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to