PDA

View Full Version : Carousel.prev() not working?



arlo.carreon
7 Jul 2010, 11:55 AM
I am using the next() and prev() methods for my carousel in Sencha Touch. The next() method works perfectly but prev() throws an error: Uncaught TypeError: Object [object Object] has no method 'prev'

Here is my code sample, property "position" was added on by me:


// Determine whether to move forward or backward on the list
if( propertyCarousel.getActiveItem().position < data.position )
propertyCarousel.next();
else
propertyCarousel.prev();


Like I said next works like a charm but prev does not. Has anyone had this problem before?

*Sencha Touch v0.90

miroperez
7 Jul 2010, 7:22 PM
I ran into this same problem. Turns out the api docs are incorrect. I looked in the source code and the method is actually previous().

evant
7 Jul 2010, 7:25 PM
I think this has been changed in 0.91, if I look at the source for Carousel the method is "prev".

arlo.carreon
8 Jul 2010, 5:52 AM
Code in the Sencha Touch API say prev(). I just tried out previous() and it works perfectly. Thanks for the input! :))

Working method:

propertyCarousel.previous();