Skip to content
Browse files

Register custom interface elements with their own xtype.

  • Loading branch information...
1 parent fa39b80 commit 0d16b8084ee331cbc8224730b2815fb81bbdf72e @nelstrom committed Mar 31, 2011
View
5 public/app/app.js
@@ -2,11 +2,6 @@ ToolbarDemo = new Ext.Application({
name: "ToolbarDemo",
launch: function() {
- this.views.homecard = new this.views.Homecard();
- this.views.searchcard = new this.views.Searchcard();
- this.views.actioncard = new this.views.Actioncard();
- this.views.settingscard = new this.views.Settingscard();
- this.views.morecard = new this.views.Morecard();
this.views.viewport = new this.views.Viewport();
}
});
View
10 public/app/views/Viewport.js
@@ -9,11 +9,11 @@ ToolbarDemo.views.Viewport = Ext.extend(Ext.TabPanel, {
initComponent: function() {
Ext.apply(this, {
items: [
- ToolbarDemo.views.homecard,
- ToolbarDemo.views.searchcard,
- ToolbarDemo.views.actioncard,
- ToolbarDemo.views.settingscard,
- ToolbarDemo.views.morecard
+ { xtype: 'homecard' },
+ { xtype: 'searchcard' },
+ { xtype: 'actioncard' },
+ { xtype: 'settingscard' },
+ { xtype: 'morecard' }
]
});
ToolbarDemo.views.Viewport.superclass.initComponent.apply(this, arguments);
View
2 public/app/views/actioncard.js
@@ -77,3 +77,5 @@ ToolbarDemo.views.Actioncard = Ext.extend(Ext.Panel, {
// ToolbarDemo.views.imageButtons
]
});
+
+Ext.reg('actioncard', ToolbarDemo.views.Actioncard);
View
2 public/app/views/homecard.js
@@ -12,3 +12,5 @@ ToolbarDemo.views.Homecard = Ext.extend(Ext.TabPanel, {
html: '<p>Toolbars can be used as a title bar or as a container for buttons, or you can mix and match both of these functions.</p>'
}]
});
+
+Ext.reg('homecard', ToolbarDemo.views.Homecard);
View
2 public/app/views/morecard.js
@@ -8,3 +8,5 @@ ToolbarDemo.views.Morecard = Ext.extend(Ext.NestedList, {
return new itemData.card;
}
});
+
+Ext.reg('morecard', ToolbarDemo.views.Morecard);
View
2 public/app/views/searchcard.js
@@ -8,3 +8,5 @@ ToolbarDemo.views.Searchcard = Ext.extend(Ext.Panel, {
title: "Search"
}]
});
+
+Ext.reg('searchcard', ToolbarDemo.views.Searchcard);
View
2 public/app/views/settingscard.js
@@ -26,3 +26,5 @@ ToolbarDemo.views.Settingscard = Ext.extend(Ext.form.FormPanel, {
}
]
});
+
+Ext.reg('settingscard', ToolbarDemo.views.Settingscard);

0 comments on commit 0d16b80

Please sign in to comment.
Something went wrong with that request. Please try again.