Closed TheEssenceSeeker closed 4 years ago
Hi, if you mean trigger onChange on slider, you can do it with using update
method. Check this demos: http://ionden.com/a/plugins/ion.rangeSlider/demo_interactions.html
Hi, if you mean trigger onChange on slider, you can do it with using
update
method. Check this demos: http://ionden.com/a/plugins/ion.rangeSlider/demo_interactions.html
Thank you for such a fast reply! I want to manually trigger onChange method after I use .update() to change "from" field. Is there any good way to do this?
Here is my code:
let slider = $("#payment-slider").data("ionRangeSlider");
$("#payment-sum").on("input", function () {
console.log('value changed to ', $(this).val());
slider.update({from: $(this).val()});
});
Yes:
$("#payment-slider").trigger("change");
Yes:
$("#payment-slider").trigger("change");
I've already tried this but it doesn't work :( Probably the problem is on my side. Thank you!
It is working even without trigger: https://jsfiddle.net/6mn4hubj/
Here is an example of what I'm trying to achieve https://jsfiddle.net/dhn4kb5p/3/ When I change the value inside first input, it updates slider "from" but input2 value stays the same.
You forgot about onUpdate
callback, demo:
https://jsfiddle.net/o2dzns56/
I see. Thank you!
I need to trigger onChange programmatically. How can I do it with jQuery or planJS? Thank you in advance!