How do I make JQuery UI Slider update Meteor Collection (MongoDB) without disappearing -


i have 2 meteor.collections in app. 1 contains bunch of "slider" objects, define title, max, min, base value, , step each slider. now, have 2 problems. first making sliders show in first place. i've tried put following code:

    sliders.find().foreach(function(slider) {         $("#"+slider._id).slider({             min:slider.min,             max:slider.max,             value:slider.base,             step:slider.step,             change:function(event,ui) {                 data.update({_id:data.findone({slider:event.target.id})._id}, {$set:{value:ui.value}});             }     });     }); 

in meteor.startup, @ end of client.js file, in $(document).ready() block, , nothing seems work. when paste javascript console, however, works. anyways, that's first problem.

my second problem whenever slide slider, slider disappears. can keep dragging mouse around change value, once let go of clicker, can't change value anymore. i've tried using above way , calling meteor.method changes on server side. it's fact i'm updating collection published same client makes slider disappear. short of doesn't cause disappear. how should deal this?

thanks!

have tried using template.preserve method? http://docs.meteor.com/#template_preserve


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -