$('#scroller').mobiscroll('getInst'); returns undefined

139 views
Skip to first unread message

Segolas Zoso

unread,
Feb 22, 2013, 9:33:42 AM2/22/13
to mobis...@googlegroups.com
Hi all,

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 Zoso

unread,
Feb 22, 2013, 10:43:17 AM2/22/13
to mobis...@googlegroups.com
Fixed with this code:

updateTimerView: function(hours, minutes, seconds){   
        $('#scroller').mobiscroll('setValue', [hours, minutes, seconds], false, 0.5);
Reply all
Reply to author
Forward
0 new messages