nobosh
1 Jul 2010, 6:25 PM
I have 3 TabPanel items. For the People TabPanel Items, I am trying to get a contact list to load. Currently, when the contact list loads it blocks the TabPanel at the bottom of the page, breaking the app. What is the correct way to insert the contact list in the card?
Ext.setup({
onReady: function () {
var favoritesTab = { title: 'Favorites', iconCls: 'favorites', html: 'Favorites' };
var settingsTab = { title: 'Settings', iconCls: 'settings', html: 'Settings' };
var peopleDisplay = new Ext.Component({ scroll: 'vertical',
tpl: ['<tpl for="."><div><img src="{profile_image_url}" /> <i>{from_user}</i>: {text}</div></tpl>']
});
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var groupingBase = {
tpl: '<tpl for="."><div class="contact"><strong>{firstName}</strong> {lastName}</div></tpl>',
itemSelector: 'div.contact',
singleSelect: true,
grouped: true,
indexBar: true,
store: new Ext.data.Store({
model: 'Contact',
sorters: 'firstName',
getGroupString : function(record) {
return record.get('firstName')[0];
},
data: [
{firstName: 'Ape', lastName: 'Evilias'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'},
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'},
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'}
]
})
};
var peopleTab = { id: 'peopleTab', title: 'People', iconCls: 'team', layout: 'card', items: [{ html: 'Please Wait...' }, groupingBase],
listeners: {
activate: function () {
if (!Ext.platform.isPhone) {
new Ext.List(Ext.apply(groupingBase, {})).show();
}
this.getLayout().setActiveItem(0);
}
}
};
new Ext.TabPanel({ fullscreen: true, tabBar: { dock: 'bottom', layout: { pack: 'center'} }, animation: { type: 'fade' },
items: [favoritesTab, peopleTab, settingsTab]
});
}
});
Thanks
Ext.setup({
onReady: function () {
var favoritesTab = { title: 'Favorites', iconCls: 'favorites', html: 'Favorites' };
var settingsTab = { title: 'Settings', iconCls: 'settings', html: 'Settings' };
var peopleDisplay = new Ext.Component({ scroll: 'vertical',
tpl: ['<tpl for="."><div><img src="{profile_image_url}" /> <i>{from_user}</i>: {text}</div></tpl>']
});
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var groupingBase = {
tpl: '<tpl for="."><div class="contact"><strong>{firstName}</strong> {lastName}</div></tpl>',
itemSelector: 'div.contact',
singleSelect: true,
grouped: true,
indexBar: true,
store: new Ext.data.Store({
model: 'Contact',
sorters: 'firstName',
getGroupString : function(record) {
return record.get('firstName')[0];
},
data: [
{firstName: 'Ape', lastName: 'Evilias'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'},
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'},
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'}
]
})
};
var peopleTab = { id: 'peopleTab', title: 'People', iconCls: 'team', layout: 'card', items: [{ html: 'Please Wait...' }, groupingBase],
listeners: {
activate: function () {
if (!Ext.platform.isPhone) {
new Ext.List(Ext.apply(groupingBase, {})).show();
}
this.getLayout().setActiveItem(0);
}
}
};
new Ext.TabPanel({ fullscreen: true, tabBar: { dock: 'bottom', layout: { pack: 'center'} }, animation: { type: 'fade' },
items: [favoritesTab, peopleTab, settingsTab]
});
}
});
Thanks