Greetings!

I'm currently creating a component that gets a different layout in landscape and portrait mode.
It's a dataview that scrolls horizontally when in landscape mode, but vertical in portrait mode.

code:

Code:
Ext.define('Tijdschrift.util.HorizontalSlider', {
   extend: 'Ext.DataView',
    xtype: 'horizontalslider',
    config: {
         scrollable: 'horizontal',
        
		 inline: {
         	wrap: false
         },
		//set the itemtpl to show the fields for the store
        itemTpl: new Ext.XTemplate(
        		'<div class="listItem">' +
        			'<div class="thumbnail">' +
        				'<img src="{thumbnail}">' +
        			'</div>'+
        			'<div class="horizontal_category_name">' +
        			'<span class="whiteBlueButton">{name}</span>' +
        			'</div>' +
        		'</div>'),
       listeners : {
		    painted : function (cmp, eOpts)
		    {
		    	this.changeOrientationSettings(Ext.Viewport.getOrientation());
		    }
       }
    },
    
    changeLayout : function(layoutMode)
    {
    	console.log("mode : " + layoutMode);
    	this.hide();
    	this.changeOrientationSettings(layoutMode);
    	this.show();
    },
    changeOrientationSettings : function (layoutMode)
    {
    	if(layoutMode == "portrait")
    	{	
    		this.setHeight(460);
    		this.setInline(true);
    		this.setScrollable("vertical");
    	}
    		
    	else
    	{
    		this.setHeight(205);
    		this.setInline({wrap:false});
    		this.setScrollable("horizontal");
    	}
    	Tijdschrift.util.Utils.Trace(this.scrollable);
    }
});
Now, here's what happens:

If you don't scroll in portrait / landscape, it gets rendered just fine on orientation change. Yaah!
But:

1) if you are in portrait mode and you scroll the list all the way down (so you can see the last items) and rotate to landscape, the list appears to be empty. But it's not. It's just out of sight. I can scroll horizontally , that's good, but I need to find a way to reset the position of scroller.

2) same for going from landscape to portrait.

So: I need to find a way to reset my scroller, it think.

I've tried scrollto, moveto, this.scrollable.getScroller(). setting x:0,y:0 but nothing seems to work.


Any help would be much appreciated!

Sencha on!

M.