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
25 Ext.define('FeedViewer.App', {
26 extend: 'Ext.container.Viewport',
28 initComponent: function(){
31 extend: 'Ext.data.Model',
32 fields: ['title', 'url']
35 Ext.define('FeedItem', {
36 extend: 'Ext.data.Model',
37 fields: ['title', 'author', {
40 }, 'link', 'description', 'content']
46 items: [this.createFeedPanel(), this.createFeedInfo()]
48 this.callParent(arguments);
52 * Create the list of fields to be shown on the left
54 * @return {FeedViewer.FeedPanel} feedPanel
56 createFeedPanel: function(){
57 this.feedPanel = Ext.create('widget.feedpanel', {
66 url: 'http://feeds.feedburner.com/extblog'
68 title: 'Sencha Forums',
69 url: 'http://sencha.com/forum/external.php?type=RSS2'
72 url: 'http://feeds.feedburner.com/ajaxian'
76 feedselect: this.onFeedSelect
79 return this.feedPanel;
83 * Create the feed info container
85 * @return {FeedViewer.FeedInfo} feedInfo
87 createFeedInfo: function(){
88 this.feedInfo = Ext.create('widget.feedinfo', {
96 * Reacts to a feed being selected
99 onFeedSelect: function(feed, title, url){
100 this.feedInfo.addFeed(title, url);