Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / app / feed-viewer / app / view / feed / Add.js
1 Ext.define('FV.view.feed.Add', {
2         extend: 'Ext.window.Window',
3
4         alias: 'widget.feedwindow',
5
6     requires: ['Ext.form.Panel', 'Ext.form.field.ComboBox'],
7
8         defaultFeeds: [
9                 ['http://rss.cnn.com/rss/edition.rss', 'CNN Top Stories'],
10                 ['http://sports.espn.go.com/espn/rss/news', 'ESPN Top News'],
11                 ['http://news.google.com/news?ned=us&topic=t&output=rss', 'Sci/Tech - Google News'],
12                 ['http://rss.news.yahoo.com/rss/software', 'Yahoo Software News']
13         ],
14
15         height: 129,
16         width: 400,
17         title: 'Add Feed',
18         closeAction: 'hide',
19         iconCls: 'rss',
20         layout: 'fit',
21
22         initComponent: function() {
23                 Ext.apply(this, {
24                         buttons: [{
25                                 text: 'Add feed',
26                                 action: 'create'
27                         }, {
28                                 text: 'Cancel',
29                                 scope: this,
30                                 handler: this.close
31                         }],
32
33                         items: [{
34                                 xtype: 'form',
35                                 bodyStyle: 'padding: 10px;',
36                                 items: [{
37                                         itemId: 'feed',
38                                         anchor: '0',
39                                         fieldLabel: 'Enter the URL of the feed to add',
40                                         labelAlign: 'top',
41                                         msgTarget: 'under',
42                                         xtype: 'combo',
43                                         store: this.defaultFeeds,
44                                         getInnerTpl: function() {
45                                                 return '<div class="feed-picker-url">{field1}</div><div class="feed-picker-title">{field2}</div>';
46                                         }
47                                 }]
48                         }]
49                 });
50
51                 this.callParent(arguments);
52         }
53 });