PDA

View Full Version : How to create master page for mvc application



sandy52
15 Jan 2014, 3:54 AM
Hi,
I have done one controller views calling but now I want to create master page on which i will put links of all controllers views calling purpose just like .net mvc layout page. How can i do this, need a help.



Ragards,
Sandy

palakurthivishal
15 Jan 2014, 8:19 AM
Hello Sandy,
If your application requires master page for all the screens/views, just give your viewport a border layout and add the required common regions in that and make your center region to hold all the rest of the views. Just like,

Ext.Viewport (http://docs.sencha.com/extjs/3.4.0/#%21/api/Ext.Viewport)({ layout: 'border', items: [{ region: 'north',
// add your customization }, { region: 'east',
// add your customization },{
region : 'center',
xtype : 'yourViewsGoesHere'
}]});* This way is suited only if you need master page for all the views.

sandy52
16 Jan 2014, 1:05 AM
okay thanks dude.. is any sample example present on net ???

palakurthivishal
21 Jan 2014, 2:39 AM
No Bro,
Now that you know how to do it, you design an example so, I'll suggest your example to others.. :)

sandy52
22 Jan 2014, 3:11 AM
Hi palakurthivishal (http://www.sencha.com/forum/member.php?606961-palakurthivishal) ,
I have created one viewport with the give help from you. Hope it will help to you


Ext.define('Dinerware.view.Viewport', {
renderTo: Ext.getBody(),
extend: 'Ext.container.Viewport',
requires: [
'Ext.window.MessageBox',
'Ext.data.TreeStore',
'Ext.tree.Panel',
'Ext.tab.Panel',
'Ext.layout.container.Border'
],
id: 'viewport',
layout: 'border',
items: [
{
region: 'west',
xtype: 'treepanel',
title: 'Dinerware',
itemId: 'main-nav-tree',
width: 150,
rootVisible: false,
root: {
expanded: true,
children: [
{
text: 'Home',
leaf: true,
href: '#'
},

{
text: 'Menu Item Sql',
leaf: true,
href:'#MenuItemSql'
},
{
text: 'Ticket Sql',
leaf: true,
href:'#TicketSql'
},
{
text: 'Menu Item Raven',
leaf: true,
href:'#MenuItemRaven'
},
{
text: 'Ticket Raven',
leaf: true,
href:'#TicketRaven'
}
]
}
},
{
region: 'center',
xtype: 'tabpanel',
defaults: {
closable:true
},
items: [
{
title: 'Home',
autoScroll: true,
closable: false,
bodyPadding: '20',
html: [
'<h1>Dinerware</h1>',
'<h6>Copyrights @2013 dinerware</h6>'
]
}
]
}
]
});


Regards,
Sandy