3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * @class FeedViewer.FeedViewer
17 * @extends Ext.container.Viewport
19 * The main FeedViewer application
22 * Create a new Feed Viewer app
23 * @param {Object} config The config object
26 Ext.define('FeedViewer.App', {
27 extend: 'Ext.container.Viewport',
29 initComponent: function(){
32 extend: 'Ext.data.Model',
33 fields: ['title', 'url']
36 Ext.define('FeedItem', {
37 extend: 'Ext.data.Model',
38 fields: ['title', 'author', {
41 }, 'link', 'description', 'content']
47 items: [this.createFeedPanel(), this.createFeedInfo()]
49 this.callParent(arguments);
53 * Create the list of fields to be shown on the left
55 * @return {FeedViewer.FeedPanel} feedPanel
57 createFeedPanel: function(){
58 this.feedPanel = Ext.create('widget.feedpanel', {
67 url: 'http://feeds.feedburner.com/extblog'
69 title: 'Sencha Forums',
70 url: 'http://sencha.com/forum/external.php?type=RSS2'
73 url: 'http://feeds.feedburner.com/ajaxian'
77 feedselect: this.onFeedSelect
80 return this.feedPanel;
84 * Create the feed info container
86 * @return {FeedViewer.FeedInfo} feedInfo
88 createFeedInfo: function(){
89 this.feedInfo = Ext.create('widget.feedinfo', {
97 * Reacts to a feed being selected
100 onFeedSelect: function(feed, title, url){
101 this.feedInfo.addFeed(title, url);