0

I'm having the hardest time getting Mobiscroll to fire off any of the documented methods in the onShow event. Here's my code:

    var scrollerVals = $('#select').scroller({
        theme: 'default',
        display: 'inline',
        mode: 'scroller',
        wheels: 
            [{
                'Time': { night: 'Night', day: 'Day' }, 
            }, 
            {
                'Place': { bar: 'Bar', club: 'Club', store: 'Store', cafe: 'Cafe' }, 
            }, 
            {
                'Size': { 1: '1', 2: '2', 3: '3' }, 
            }],
        onChange: function(valueText, inst) {
            scrollerVals = inst.temp;
        },
        onShow: function() {
            $(this).scroller('setValue', ["night", "club", "1"]);
        }
    });

The onChange event is working fine, and I verified that the onShow event is firing like it should; but for some reason I cannot get the setValue line to work. The initial values for the array remain undefined (until I change the wheel, which fires off the onChange event and defines the array). I've tried the 'hide' method in onShow, and it won't work either. However, the exact same hide method works fine when I move the line to the onChange event. So I'm befuddled. Any help would be greatly appreciated!

primes2357
  • 178
  • 2
  • 8

1 Answers1

1

Check out this jsFiddle for the solution http://jsfiddle.net/kovlex/Kapye/1/

Levi Kovacs
  • 1,159
  • 8
  • 14