PDA

View Full Version : Access a specific page in a carousel from a list in another tab



miklan
15 Jul 2011, 1:27 AM
Hello,

I am new to sencha touch and have a (hopefully easy) question.

I have three tabs and on one of them I have a list (the code below) and on another one I have a carousel. What I want to happen is that when I tap one of the names in my list it should take me to the right page in the carousel. This means it has to change tab and then bring forth the right page in the carousel. Is this possible and how is it done?

Hope you understand what I mean. Any help is very appreciated!

The list:

var groupingBase = {
title: 'Index',
iconCls: 'search',
cls: 'barIcon',
itemTpl: '<div class="contact2"><strong>{name}</strong> {number}</div>',
selModel: {
mode: 'SINGLE',
allowDeselect: false
},
grouped: false,
indexBar: false,

store: new Ext.data.Store({
model: 'Contact',
getGroupString : function(record) {
return record.get('name')[0];
},
data: [
{name: 'Porthos visa', number: '1'}, {name: 'Mediehymnen', number: '2'}, {name: 'Mediemarschen', number: '3'}, {name: 'S√•ng f√∂r Medieteknik', number: '4'}, {name: 'Stackars Tecknis', number: '5'}, {name: 'Mamma Media', number: '6'}, {name: 'Vintern rasat ner √∂ver Media', number: '7'}, {name: 'Typografens lycka', number: '8'}, {name: 'Mediebitar', number: '9'}, {name: 'Undan, ur v√§gen', number: '10'}, {name: 'Maskinare', number: '11'}, {name: 'Du gamla du fria', number: '12'}, {name: 'Kungss√•ngen', number: '13'}, {name: 'Students√•ngen', number: '14'}, {name: 'Osquar', number: '15'}, {name: '√Ąn en g√•ng d√§ran', number: '16'}, {name: 'F.M. Franz√©ns dryckesvisa', number: '17'}, {name: 'Nu gr√∂nskar det', number: '18'}
]
})
};

The carousel:

browse_songs = new Ext.Carousel({
layout: 'fit',
title: 'Bläddra',
iconCls: 'bookmarks',
cls: 'barIcon',
items: [{title: 'Portos visa',
html: '<h3>Portos visa</h3><p>Jag vill börja gasquea....</p>'},
{title: 'Kalmarevisan',
html: '<h3>Kalmarevisan</h3><p>Förut i Kalmarestad....</p>'},
{title: 'En liten blå förgetmigej',
html: '<h3>En liten blå förgetmigej</h3><p>Hur länge skall ej vara eller nåt sånt....</p>'}]
});

PS. The names are in Swedish