只要我通常只使用一个带有边框布局的视口,我就可以放置和移除组件并更改它们的布局,但是当我的应用程序有不同的入口点时......
假设您有一个应用程序是一个销售商店,客户和员工应该访问该应用程序,在这种情况下您会怎么做?
我认为,当您有不同的入口点并应根据业务规则呈现不同的组件时,多个视口也很方便。
SalesApp
app
model
view
controller
store
employees.html //includes employees.js
customers.html //includes customers.js
employees.js //includes all views, models controllers and stores required
customers.js //...
在employees.js 中,您将创建一个像这样的视口:
Ext.application({
requires: ['Ext.container.Viewport'],
name: 'RCV2',
appFolder: 'app',
controllers: [],
views: [
"ReporteConcentradoGrid",
"ParametrosReporteConcentradoForm"
],
stores: [
"ReporteConcentradoStore"
],
model: [
"RegistroReporteConcentrado"
],
launch: function () {
Ext.create("Ext.container.Viewport",{
layout: 'border',
items:[
{
xtype: 'prcf',
title: 'Filtros',
region: 'north',
height: 100
},
{
xtype: 'reporteconcentradogrid',
region: 'center'
}
]
});
}
});