0

I have this function to update the time:

updateTimerView: function(hours, minutes, seconds){
        var inst = $('#scroller').mobiscroll('getInst');
        inst.temp = [hours, minutes, seconds];
}

But I always get the error: TypeError: inst is undefined

This same function works if I pass the inst as parameter, for example retrieving the inst with a onBeforeShow: function (dw, inst). So, just to be clear, this works:

updateTimerView: function(inst, hours, minutes, seconds){
        inst.temp = [hours, minutes, seconds];
}

Also the method getInst is not listed here: but here it says that is a way to get the scroller instance.

Any idea?

Segolas
  • 575
  • 2
  • 10
  • 26

1 Answers1

0

Fixed with this code:

updateTimerView: function(hours, minutes, seconds){
$('#scroller').mobiscroll('setValue', [hours, minutes, seconds], false, 0.5); }

Segolas
  • 575
  • 2
  • 10
  • 26