0

I have a ion.rangeslider which has 4 callbacks: onStart, onUpdate, onChange, onFinish.

I have a button function. How can call the onUpdate callback from button?

 $("#range").ionRangeSlider({
 min: +moment().subtract(3, "days").format("X"),
 max: +moment().add(1, "days").format("X"),
 from: +moment().format("X"),
 step: 10800,
 grid: true,
 grid_num: 16,
 force_edges: true,
onUpdate: function (data){
alert ("Update value");
}
});


function buttonClick(){
 // here i want to call onUpdate;
}

Thanks in advance!

  • Define the callback function in a separate place, reference it in your slider configuration, and call it in `buttonClick`. – Cerbrus Oct 18 '19 at 07:18
  • Could you please give me a hint, how to do that? – John Deligiannis Oct 18 '19 at 07:19
  • 2
    Define the callback function just like you did for `buttonClick`. Then: `onUpdate: myCallback` and in your `buttonClick`: `myCallback()`. Note how I left out the `()` in `onUpdate`. You're only referencing the function there. Not calling it. – Cerbrus Oct 18 '19 at 07:20

0 Answers0