PDA

View Full Version : Carousel: next() works, but prev() doesn't?



OliverD
14 Jul 2010, 6:03 AM
I've created a carousel but I want to have a couple of buttons so that you can navigate that way in addition to swiping left and right. So I have a toolbar with "Previous" and "Next" buttons. Here are my button handlers:


var tapPrevious = function(button, event) {
carousel.prev();
carousel.doLayout();
};

var tapForward = function(button, event) {
carousel.next();
carousel.doLayout();
};

The tapForward function works fine, but tapPrevious doesn't work at all. I'm stumped!

OliverD
14 Jul 2010, 6:04 AM
Nevermind. I see that the API docs say the function is called prev(), but it is actually previous().

TommyMaintz
14 Jul 2010, 1:01 PM
May I ask what version of Sencha Touch you are using? In the latest code base the function is called prev().

OliverD
15 Jul 2010, 4:35 AM
Oops, looks like I'm using 0.9.0.

TommyMaintz
15 Jul 2010, 11:40 AM
Ok, thats what I thought. ;) In the latest version it is called prev.