Closed moens closed 9 years ago
Easy, just trigger the following once the select value has changed.
this.data('picker').sync_picker_with_select();
Just remember to replace this
with the element the image picker is assigned to (the select dropdown object). So long as something triggers the sync check, it'll change the image picker accordingly (I use this to great effect with a select all button).
Exactly what @SgtOddball said. Thanks for taking the time to answer this.
Thanks, just what I needed... but in the future I expect faster turn-around on answers to these issues... jk ;) you guys are freaking awesome.
@rvera, thanks for the image-picker. Point me to a paypal donate button or something. I'll buy you a beer or two.
Haha, thanks @moens but it's not necessary. Maybe @SgtOddball would take you up on that offer?
I'm glad you find it useful.
meh... ok, someone should benefit (not just me)!
I've got enough beer kicking around and besides, @rvera did the main work. I just happened to have the code to hand.
Well, thanks all!
(tl;dr) My js is weak... How should I trigger image-picker to update the selected value from external js?
I have a form which is populated with values from an existing model. If the user feels they have screwed up the form, a button allows them to reset original model values. The image picker js is not triggered, so even though the form value for a select is reset, image-picker is not aware of the select value update, and the form select presentation is incorrect. TIA