Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add About/Bookmarks cards to MoreCard.

  • Loading branch information...
commit 43084a504a682a2c915e9e5281b6f022021232fd 1 parent a79ec8b
@nelstrom nelstrom authored
View
5 app.js
@@ -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'
});
}
-});
+});
View
3  app/controller/Main.js
@@ -5,5 +5,4 @@ Ext.define('Sencha.controller.Main', {
refs: {},
control: {}
}
-
-});
+});
View
11 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' }
+ ]
+ }
+});
View
10 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
+ }
+});
View
10 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
+ }
+});
View
20 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
+ });
+ }
+ }
+ }]
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.