PDA

View Full Version : Scrolling after panel.update not working



aschoenfeld
25 Jan 2011, 4:06 AM
Hi,

I'm new to Sencha Touch, so maybe I'm just missing something basic ;)

I have a panel that contains a carousel and another panel:

...
rootPanel = new Ext.Panel({
fullscreen: true,
layout: {
type: 'card',
align: 'stretch'
},
items: [carousel, bigview],
...

The other panel looks like this:

bigview = new Ext.Panel({
title: 'Test',
scroll: 'both',
html:'<img src="./img/page1.jpg" />'
});

If I show the other panel with rootPanel.setActiveItem(1); it scrolls just fine.
The problem occurs if I change the html content like this:

bigview.body.update('<img src="./img/page2.jpg" />')

It will still switch to the other panel, but I can't scroll the image any more.

Using Sencha Touch 1.0.1a

Thanks :)

AndreaCammarata
25 Jan 2011, 8:47 AM
Hi,
To solve your issue just edit


bigview.body.update('<img src="./img/page2.jpg" />')
with



bigview.update('<img src="./img/page2.jpg" />')
Hope this helps.

aschoenfeld
25 Jan 2011, 11:48 PM
Hi Andrea,

If I change it like that I can scroll, but it won't change the image anymore.

AndreaCammarata
26 Jan 2011, 12:00 AM
Which version are you using?

This example I develop works for me without problem



Ext.setup({
icon: 'icon.png',
glossOnIcon: false,
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
onReady: function() {
var bigview = new Ext.Panel({
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
title: 'Example',
items: [{
text: 'Change Picture',
ui: 'action',
handler: function(){
bigview.update('<img src="http://flash3d.files.wordpress.com/2008/05/ivanov1.jpg" />');
}
}]
}],
fullscreen: true,
scroll: 'both',
html:'<img src="http://ilserpentedigaleno.blogosfere.it/images/3D.jpg" />'
});
}
});
Does it works for you?