Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / app / feed-viewer / app / view / feed / Add.js
diff --git a/examples/app/feed-viewer/app/view/feed/Add.js b/examples/app/feed-viewer/app/view/feed/Add.js
new file mode 100644 (file)
index 0000000..21cc279
--- /dev/null
@@ -0,0 +1,53 @@
+Ext.define('FV.view.feed.Add', {
+       extend: 'Ext.window.Window',
+
+       alias: 'widget.feedwindow',
+
+    requires: ['Ext.form.Panel', 'Ext.form.field.ComboBox'],
+
+       defaultFeeds: [
+               ['http://rss.cnn.com/rss/edition.rss', 'CNN Top Stories'],
+               ['http://sports.espn.go.com/espn/rss/news', 'ESPN Top News'],
+               ['http://news.google.com/news?ned=us&topic=t&output=rss', 'Sci/Tech - Google News'],
+               ['http://rss.news.yahoo.com/rss/software', 'Yahoo Software News']
+       ],
+
+       height: 129,
+       width: 400,
+       title: 'Add Feed',
+       closeAction: 'hide',
+       iconCls: 'rss',
+       layout: 'fit',
+
+       initComponent: function() {
+               Ext.apply(this, {
+                       buttons: [{
+                               text: 'Add feed',
+                               action: 'create'
+                       }, {
+                               text: 'Cancel',
+                               scope: this,
+                               handler: this.close
+                       }],
+
+                       items: [{
+                               xtype: 'form',
+                               bodyStyle: 'padding: 10px;',
+                               items: [{
+                                       itemId: 'feed',
+                                       anchor: '0',
+                                       fieldLabel: 'Enter the URL of the feed to add',
+                                       labelAlign: 'top',
+                                       msgTarget: 'under',
+                                       xtype: 'combo',
+                                       store: this.defaultFeeds,
+                                       getInnerTpl: function() {
+                                               return '<div class="feed-picker-url">{field1}</div><div class="feed-picker-title">{field2}</div>';
+                                       }
+                               }]
+                       }]
+               });
+
+               this.callParent(arguments);
+       }
+});