Skip to content

Commit

Permalink
Move all complex types from config to initComponent().
Browse files Browse the repository at this point in the history
  • Loading branch information
nelstrom committed Apr 7, 2011
1 parent 63f2e44 commit 61271b4
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 62 deletions.
32 changes: 19 additions & 13 deletions public/app/views/Viewport.js
@@ -1,16 +1,22 @@
ToolbarDemo.views.Viewport = Ext.extend(Ext.TabPanel, {
fullscreen: true,
tabBar: {
dock: 'bottom',
layout: {
pack: 'center'
}
},
items: [
{ xtype: 'homecard', id: 'home' },
{ xtype: 'searchcard' },
{ xtype: 'actioncard' },
{ xtype: 'settingscard' },
{ xtype: 'morecard' }
]

initComponent: function() {
Ext.apply(this, {
tabBar: {
dock: 'bottom',
layout: {
pack: 'center'
}
},
items: [
{ xtype: 'homecard', id: 'home' },
{ xtype: 'searchcard' },
{ xtype: 'actioncard' },
{ xtype: 'settingscard' },
{ xtype: 'morecard' }
]
});
ToolbarDemo.views.Viewport.superclass.initComponent.apply(this, arguments);
}
});
21 changes: 14 additions & 7 deletions public/app/views/actioncard.js
Expand Up @@ -75,13 +75,20 @@
iconCls: "action",
styleHtmlContent: true,
html: "placeholder text",
dockedItems: [
topbar,
//textButtonShapes,
//textButtonColors,
//mixedTextButtons,
//imageButtons
]

initComponent: function() {
Ext.apply(this, {
dockedItems: [
topbar,
//textButtonShapes,
//textButtonColors,
//mixedTextButtons,
//imageButtons
]
});

ToolbarDemo.views.Actioncard.superclass.initComponent.apply(this, arguments);
}
});

Ext.reg('actioncard', ToolbarDemo.views.Actioncard);
Expand Down
29 changes: 17 additions & 12 deletions public/app/views/homecard.js
@@ -1,18 +1,23 @@
ToolbarDemo.views.Homecard = Ext.extend(Ext.TabPanel, {
title: "home",
iconCls: "home",
defaults: {
styleHtmlContent: true
},
items: [{
title: 'TabPanels',
scroll: 'vertical',
html: '<p>The TabPanel provides a familiar tabbed interface that enables you to switch between different panels. It comes in two distinct flavours. When the tab bar is top-docked, each tab takes on the appearance of a button with a text label. But if you dock the tab bar to the bottom, then each tab button can be assigned an icon, as well as a text label. The icons are styled with an active and inactive state, which has a native look and feel.</p>'
},{
title: 'Toolbars',
scroll: 'vertical',
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>'
}]
initComponent: function() {
Ext.apply(this, {
defaults: {
styleHtmlContent: true
},
items: [{
title: 'TabPanels',
scroll: 'vertical',
html: '<p>The TabPanel provides a familiar tabbed interface that enables you to switch between different panels. It comes in two distinct flavours. When the tab bar is top-docked, each tab takes on the appearance of a button with a text label. But if you dock the tab bar to the bottom, then each tab button can be assigned an icon, as well as a text label. The icons are styled with an active and inactive state, which has a native look and feel.</p>'
},{
title: 'Toolbars',
scroll: 'vertical',
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>'
}]
});
ToolbarDemo.views.Homecard.superclass.initComponent.apply(this, arguments);
}
});

Ext.reg('homecard', ToolbarDemo.views.Homecard);
13 changes: 9 additions & 4 deletions public/app/views/morecard.js
@@ -1,11 +1,16 @@
ToolbarDemo.views.Morecard = Ext.extend(Ext.NestedList, {
title: "More",
iconCls: "more",
store: ToolbarDemo.morestore,
cardSwitchAnimation: 'slide',
getDetailCard: function(item, parent) {
var itemData = item.attributes.record.data;
return itemData.card;
initComponent: function() {
Ext.apply(this, {
store: ToolbarDemo.morestore,
getDetailCard: function(item, parent) {
var itemData = item.attributes.record.data;
return itemData.card;
}
});
ToolbarDemo.views.Morecard.superclass.initComponent.apply(this, arguments);
}
});

Expand Down
13 changes: 9 additions & 4 deletions public/app/views/searchcard.js
Expand Up @@ -3,10 +3,15 @@ ToolbarDemo.views.Searchcard = Ext.extend(Ext.Panel, {
iconCls: "search",
styleHtmlContent: true,
html: "placeholder text",
dockedItems: [{
xtype: "toolbar",
title: "Search"
}]
initComponent: function() {
Ext.apply(this, {
dockedItems: [{
xtype: "toolbar",
title: "Search"
}]
});
ToolbarDemo.views.Searchcard.superclass.initComponent.apply(this, arguments);
}
});

Ext.reg('searchcard', ToolbarDemo.views.Searchcard);
48 changes: 26 additions & 22 deletions public/app/views/settingscard.js
Expand Up @@ -2,29 +2,33 @@ ToolbarDemo.views.Settingscard = Ext.extend(Ext.form.FormPanel, {
title: "settings",
iconCls: "settings",
scroll: "vertical",
dockedItems: [{
xtype: "toolbar",
title: "Settings"
}],
items: [
{
xtype: 'fieldset',
title: 'Details',
items: [{
xtype: 'textfield',
name : 'name',
label: 'Username'
},{
xtype: 'passwordfield',
name : 'password',
label: 'Password'
initComponent: function() {
Ext.apply(this, {
dockedItems: [{
xtype: "toolbar",
title: "Settings"
}],
},{
xtype: 'button',
text: 'save',
ui: 'confirm'
}
]
items: [
{
xtype: 'fieldset',
title: 'Details',
items: [{
xtype: 'textfield',
name : 'name',
label: 'Username'
},{
xtype: 'passwordfield',
name : 'password',
label: 'Password'
}],
},{
xtype: 'button',
text: 'save',
ui: 'confirm'
}]
});
ToolbarDemo.views.Settingscard.superclass.initComponent.apply(this, arguments);
}
});

Ext.reg('settingscard', ToolbarDemo.views.Settingscard);

0 comments on commit 61271b4

Please sign in to comment.