omulriain
28 Sep 2010, 8:11 AM
I am attempting to scroll a panel within a carousel. It works but I am getting an error. Is there something the carousel needs or something I can pass in to illiminate this. I can catch the error and everything works but I don't want to have any errors.
the culprit is newCard.scroller._scrollTo(oldCard.scroller.offset,1,'easingOutStrong'); as seen below.
my listener.
var timeline1 = new Ext.Component({
title: 'Timeline',
cls: 'timeline',
scroll: 'vertical',
tpl: [
'<table width="100%" border="1">',
'<tpl for=".">',
'<tr>',
'<td>{col1}</td>',
'<td>{col2}</td>',
'<td>{col3}</td>',
'<td>{col4}</td>',
'</tr>',
'</tpl>',
'</table>'
]
});
//timeline2 and timeline3 same as timeline1
var tableCarousel = new Ext.Carousel({
iconCls: 'bookmarks',
cls: 'card card2',
title: 'Guide',
ui: 'light',
monitorOrientation: 'true',
listeners: {
cardswitch: function(container, newCard, oldCard){
newCard.scroller.offset = oldCard.scroller.offset;
newCard.scroller._scrollTo(oldCard.scroller.offset,1,'easingOutStrong');
}
}
,items: [timeline1,timeline2,timeline3]
});
I am getting the following error:
Uncaught TypeError: Cannot read property 'y' of undefined
scrollToext-touch-debug.js:12651
_scrollToext-touch-debug.js:12196
tableCarousel.Ext.Carousel.listeners.cardswitchindex.js:370
fireext-touch-debug.js:940
fireEventext-touch-debug.js:569
onCardSwitchext-touch-debug.js:16349
onCardSwitchext-touch-debug.js:19144
onTransitionEndext-touch-debug.js:19135
anonymous:5
(anonymous function)ext-touch-debug.js:3253
the culprit is newCard.scroller._scrollTo(oldCard.scroller.offset,1,'easingOutStrong'); as seen below.
my listener.
var timeline1 = new Ext.Component({
title: 'Timeline',
cls: 'timeline',
scroll: 'vertical',
tpl: [
'<table width="100%" border="1">',
'<tpl for=".">',
'<tr>',
'<td>{col1}</td>',
'<td>{col2}</td>',
'<td>{col3}</td>',
'<td>{col4}</td>',
'</tr>',
'</tpl>',
'</table>'
]
});
//timeline2 and timeline3 same as timeline1
var tableCarousel = new Ext.Carousel({
iconCls: 'bookmarks',
cls: 'card card2',
title: 'Guide',
ui: 'light',
monitorOrientation: 'true',
listeners: {
cardswitch: function(container, newCard, oldCard){
newCard.scroller.offset = oldCard.scroller.offset;
newCard.scroller._scrollTo(oldCard.scroller.offset,1,'easingOutStrong');
}
}
,items: [timeline1,timeline2,timeline3]
});
I am getting the following error:
Uncaught TypeError: Cannot read property 'y' of undefined
scrollToext-touch-debug.js:12651
_scrollToext-touch-debug.js:12196
tableCarousel.Ext.Carousel.listeners.cardswitchindex.js:370
fireext-touch-debug.js:940
fireEventext-touch-debug.js:569
onCardSwitchext-touch-debug.js:16349
onCardSwitchext-touch-debug.js:19144
onTransitionEndext-touch-debug.js:19135
anonymous:5
(anonymous function)ext-touch-debug.js:3253