Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / examples / app / feed-viewer / app / view / feed / Add.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
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.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 Ext.define('FV.view.feed.Add', {
16         extend: 'Ext.window.Window',
17
18         alias: 'widget.feedwindow',
19
20     requires: ['Ext.form.Panel', 'Ext.form.field.ComboBox'],
21
22         defaultFeeds: [
23                 ['http://rss.cnn.com/rss/edition.rss', 'CNN Top Stories'],
24                 ['http://sports.espn.go.com/espn/rss/news', 'ESPN Top News'],
25                 ['http://news.google.com/news?ned=us&topic=t&output=rss', 'Sci/Tech - Google News'],
26                 ['http://rss.news.yahoo.com/rss/software', 'Yahoo Software News']
27         ],
28
29         height: 129,
30         width: 400,
31         title: 'Add Feed',
32         closeAction: 'hide',
33         iconCls: 'rss',
34         layout: 'fit',
35
36         initComponent: function() {
37                 Ext.apply(this, {
38                         buttons: [{
39                                 text: 'Add feed',
40                                 action: 'create'
41                         }, {
42                                 text: 'Cancel',
43                                 scope: this,
44                                 handler: this.close
45                         }],
46
47                         items: [{
48                                 xtype: 'form',
49                                 bodyStyle: 'padding: 10px;',
50                                 items: [{
51                                         itemId: 'feed',
52                                         anchor: '0',
53                                         fieldLabel: 'Enter the URL of the feed to add',
54                                         labelAlign: 'top',
55                                         msgTarget: 'under',
56                                         xtype: 'combo',
57                                         store: this.defaultFeeds,
58                                         getInnerTpl: function() {
59                                                 return '<div class="feed-picker-url">{field1}</div><div class="feed-picker-title">{field2}</div>';
60                                         }
61                                 }]
62                         }]
63                 });
64
65                 this.callParent(arguments);
66         }
67 });
68