日期:2014-05-16 浏览次数:20372 次
//file: app/view/Main.js
Ext.define('myapp.view.Main', {
extend: 'Ext.tab.Panel',
xtype: 'main',
requires: [
'myapp.view.Foodmain',
'myapp.view.Usermain'
],
config: {
tabBarPosition: 'bottom',
items: [
{
xtype: 'foodmain',
title: '主页',
iconCls: 'home'
},
{
xtype: 'usermain',
title: '用户',
iconCls: 'user'
}
]
}
});
// file: app/view/Foodmain.js
Ext.define('myapp.view.Foodmain', {
extend: 'Ext.Panel',
xtype: 'foodmain',
id: 'idfoodmain',
config: {
items: [{
xtype: 'dataview',
width: 300,
store: {
fields: ['name', 'age'],
data: [
{name: 'Jamie', age: 100},
{name: 'Rob', age: 21},
{name: 'Tommy', age: 24},
{name: 'Jacky', age: 24},
{name: 'Ed', age: 26}
]
},
itemTpl: '<div>{name} is {age} years old</div>'
}]
}
});
// file: app/view/Main.js
Ext.define('myapp.view.Main', {
extend: 'Ext.tab.Panel',
xtype: 'main',
requires: [
'myapp.view.Foodmain',
'myapp.view.Usermain'
],
config: {
tabBarPosition: 'bottom',
items: [
{
xtype: 'foodmain',
title: '主页',
iconCls: 'home'
},
&n