Skip to content

Commit

Permalink
Add About/Bookmarks cards to MoreCard.
Browse files Browse the repository at this point in the history
  • Loading branch information
nelstrom committed Feb 21, 2012
1 parent a79ec8b commit 43084a5
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app.js
Expand Up @@ -2,11 +2,12 @@ Ext.application({
name: 'Sencha',

controllers: ['Main'],
views: ['Main'],
views: ['Main'],
stores: ['MoreCards'],

launch: function() {
Ext.Viewport.add({
xclass: 'Sencha.view.Main'
});
}
});
});
3 changes: 1 addition & 2 deletions app/controller/Main.js
Expand Up @@ -5,5 +5,4 @@ Ext.define('Sencha.controller.Main', {
refs: {},
control: {}
}

});
});
11 changes: 11 additions & 0 deletions app/store/MoreCards.js
@@ -0,0 +1,11 @@
Ext.define('Sencha.store.MoreCards', {
extend: 'Ext.data.Store',

config: {
fields: ['title', 'xtype'],
data: [
{ title: 'About', xtype: 'aboutcard' },
{ title: 'Bookmarks', xtype: 'bookmarkscard' }
]
}
});
10 changes: 10 additions & 0 deletions app/view/About.js
@@ -0,0 +1,10 @@
Ext.define('Sencha.view.About', {
extend: 'Ext.Panel',
xtype: 'aboutcard',

config: {
title: 'About',
html: 'Made from coffee',
styleHtmlContent: true
}
});
10 changes: 10 additions & 0 deletions app/view/Bookmarks.js
@@ -0,0 +1,10 @@
Ext.define('Sencha.view.Bookmarks', {
extend: 'Ext.Panel',
xtype: 'bookmarkscard',

config: {
title: 'Bookmarks',
html: 'Your bookmarks go here',
styleHtmlContent: true
}
});
20 changes: 19 additions & 1 deletion app/view/More.js
@@ -1,9 +1,27 @@
Ext.define('Sencha.view.More', {
extend: 'Ext.Panel',
extend: 'Ext.navigation.View',
xtype: 'morecard',
requires: [
'Ext.dataview.List',
'Sencha.view.About',
'Sencha.view.Bookmarks'
],

config: {
iconCls: 'more',
title: 'More',
items: [{
title: 'More',
xtype: 'list',
itemTpl: '{title}',
store: 'MoreCards',
listeners: {
itemtap: function(list, index, item, record) {
this.up('morecard').push({
xtype: record.data.xtype
});
}
}
}]
}
});

0 comments on commit 43084a5

Please sign in to comment.