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
Original file line number Original file line Diff line number Diff line change
@@ -1,16 +1,22 @@
ToolbarDemo.views.Viewport = Ext.extend(Ext.TabPanel, { ToolbarDemo.views.Viewport = Ext.extend(Ext.TabPanel, {
fullscreen: true, fullscreen: true,
tabBar: {
dock: 'bottom', initComponent: function() {
layout: { Ext.apply(this, {
pack: 'center' tabBar: {
} dock: 'bottom',
}, layout: {
items: [ pack: 'center'
{ xtype: 'homecard', id: 'home' }, }
{ xtype: 'searchcard' }, },
{ xtype: 'actioncard' }, items: [
{ xtype: 'settingscard' }, { xtype: 'homecard', id: 'home' },
{ xtype: 'morecard' } { 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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -75,13 +75,20 @@
iconCls: "action", iconCls: "action",
styleHtmlContent: true, styleHtmlContent: true,
html: "placeholder text", html: "placeholder text",
dockedItems: [
topbar, initComponent: function() {
//textButtonShapes, Ext.apply(this, {
//textButtonColors, dockedItems: [
//mixedTextButtons, topbar,
//imageButtons //textButtonShapes,
] //textButtonColors,
//mixedTextButtons,
//imageButtons
]
});

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


Ext.reg('actioncard', ToolbarDemo.views.Actioncard); Ext.reg('actioncard', ToolbarDemo.views.Actioncard);
Expand Down
29 changes: 17 additions & 12 deletions public/app/views/homecard.js
Original file line number Original file line Diff line number Diff line change
@@ -1,18 +1,23 @@
ToolbarDemo.views.Homecard = Ext.extend(Ext.TabPanel, { ToolbarDemo.views.Homecard = Ext.extend(Ext.TabPanel, {
title: "home", title: "home",
iconCls: "home", iconCls: "home",
defaults: { initComponent: function() {
styleHtmlContent: true Ext.apply(this, {
}, defaults: {
items: [{ styleHtmlContent: true
title: 'TabPanels', },
scroll: 'vertical', items: [{
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: 'TabPanels',
},{ scroll: 'vertical',
title: 'Toolbars', 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>'
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>' 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); Ext.reg('homecard', ToolbarDemo.views.Homecard);
13 changes: 9 additions & 4 deletions public/app/views/morecard.js
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,16 @@
ToolbarDemo.views.Morecard = Ext.extend(Ext.NestedList, { ToolbarDemo.views.Morecard = Ext.extend(Ext.NestedList, {
title: "More", title: "More",
iconCls: "more", iconCls: "more",
store: ToolbarDemo.morestore,
cardSwitchAnimation: 'slide', cardSwitchAnimation: 'slide',
getDetailCard: function(item, parent) { initComponent: function() {
var itemData = item.attributes.record.data; Ext.apply(this, {
return itemData.card; 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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ ToolbarDemo.views.Searchcard = Ext.extend(Ext.Panel, {
iconCls: "search", iconCls: "search",
styleHtmlContent: true, styleHtmlContent: true,
html: "placeholder text", html: "placeholder text",
dockedItems: [{ initComponent: function() {
xtype: "toolbar", Ext.apply(this, {
title: "Search" dockedItems: [{
}] xtype: "toolbar",
title: "Search"
}]
});
ToolbarDemo.views.Searchcard.superclass.initComponent.apply(this, arguments);
}
}); });


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

0 comments on commit 61271b4

Please sign in to comment.