Answer the question
In order to leave comments, you need to log in
IonRangeSlider not initializing?
Good afternoon. I am using the ionRangeSlider plugin. Initialization occurs in a modal form. But when the form I reopen that values remain old? Maybe someone faced this? Thank you.
Code example
(function ($) {
$('.modal').on('shown.bs.modal', function (e) {
$.each($(".probability"), function (key, value) {
$(value).ionRangeSlider({
type: 'single',
min: 0,
max: 100,
postfix: '%',
from: $(value).val(),
step: 0.5,
keyboard: true,
prettify: false,
hasGrid: true,
grid: true,
grid_snap: true
});
});
});
})(jQuery);
:
Answer the question
In order to leave comments, you need to log in
Most likely you are not destroying the instance properly. Try to do the following check before initialization:
var old = $(value).data("ionRangeSlider");
if (old) {
old.destroy();
}
$(value).ionRangeSlider({
...
from: $(value).val()
, and there it is old.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question