lundi 29 décembre 2014

Best Practices - When to create a new view?

Hello everyone,

I am wondering what is the best practice in terms of creating new views. For example, consider the following code:



Code:



Ext.application({
name: 'Sencha',


launch: function() {

Ext.create("Ext.tab.Panel", {
fullscreen: true,
tabBarPosition: 'bottom',


items: [
{
title: 'Home',
iconCls: 'home',
cls: 'home',
html: [
'',
'Welcome to Sencha Touch',
"We're creating the Getting Started app, which demonstrates how ",
"to use tabs, lists, and forms to create a simple app.",
'Sencha Touch'
].join("")
},
{
title: 'Contact',
iconCls: 'user',
xtype: 'formpanel',
url: 'contact.php',
layout: 'vbox',


items: [
{
...
}
]
}
]
});
}
});



Would it be a good idea to create new views to represent the items from the above? Like this:

Code:



Ext.application({
name: 'Sencha',


views: ['Home, Contact'],


launch: function() {

Ext.create("Ext.tab.Panel", {
fullscreen: true,
tabBarPosition: 'bottom',


items: [
{
xtype: 'home'
},
{
xtype: 'contact"
}
]
});
}
});



Thanks for your help.



Best Practices - When to create a new view?

Aucun commentaire:

Enregistrer un commentaire