PDA

View Full Version : populate a list with the selected items from another list



rajivpa
6 Jan 2011, 9:59 PM
Hi All
I have a list defined with tpl, which is getting populated from a jsonstore. Now user can select multiple items in this list and move to next page/card, where we want show him the items he selected in the list on previous page/card.

Being a newbie I have implemented the first list and populated it, I need some ideas to get the selected items from this list and populate the other list as user moves to the next card. Any ideas will be really helpful for me in meeting deadlines.

Thanks
Rajiv

Ismailp
19 Jul 2011, 4:18 AM
Okey, so after looking at a bunch of tutorials i managed to find a solution:


var fromAirports = new Ext.List({
fullscreen: true,
id: 'airportList',
indexBar: false,
itemTpl : '{firstName} {lastName}',
onItemTap: function(item, index) {
var formField = NotiflyApp.views.formField;
var selectedAirport = store.getAt(index).get('firstName');
var selectedIATA = store.getAt(index).get('lastName');
var from = Ext.ModelMgr.create(
{ from: selectedAirport + ' ' + selectedIATA }, 'Contact');
NotiflyApp.views.formField.load(from);
NotiflyApp.views.viewport.setActiveItem('formInput', {type: 'fade'});
},

store: store
});