Ext viewport的渲染

1.在app.js里创建

	Ext.application({
name: 'MySecurity',
extend: 'MySecurity.Application',
requires: [
'MySecurity.view.Viewport'
],
//添加mainView 会自动创建 viewport
mainView: 'MySecurity.view.Viewport'
});

2.在Application.js里创建

  • 在Application渲染viewport可以先处理一些其他操作再渲染界面

例如先获取某些数据,或者先执行一些其他操作,弹出窗口,显示loading等

	Ext.define('MySecurity.Application', {
extend: 'Ext.app.Application',
requires:[
'Ext.form.*',
'Ext.grid.*'
],
name: 'MySecurity', stores: [
// TODO: add global / shared stores here
//'user.UserStore'
], launch: function () {
// TODO - Launch the application
},
init: function(){
myApp = this;
//创建Viewport
Ext.create('MySecurity.view.Viewport');
},
onAppUpdate: function () {
Ext.Msg.confirm('Application Update', 'This application has an update, reload?',
function (choice) {
if (choice === 'yes') {
window.location.reload();
}
}
);
}
});

3.viewport

继承 Ext.container.Viewport

	Ext.define('MySecurity.view.Viewport', {
extend: 'Ext.container.Viewport',
requires:[
'MySecurity.view.main.MainHeader',
'MySecurity.view.main.MainTabPanel'
],
layout:{
type:'vbox',
align :'stretch'
},
controller: 'viewportcontroller',
viewModel: {
type: 'mainviewport'
},
items: [{
xtype:'mainHeader',
height:50
},{
xtype:'mainTabPanel',
flex:1
},{
xtype: 'tbtext',
cls: 'top-user-name',
bind: {
text: '{userAccess.username}'
}
}] });

最新文章

  1. [整理]AngularJS移动端开发遇到的问题
  2. jquery阻止元素冒泡的两种方法
  3. Consuming a RESTful Web Service
  4. RabbitMQ(二)
  5. 四 GPU 并行编程的存储系统架构
  6. Windows 7 搭建 nodejs、npm、express 环境
  7. Web api 文档以及测试工具配置
  8. Hibernate学习(二)保存数据
  9. GROUP BY你都不会!ROLLUP,CUBE,GROUPPING详解
  10. Mac上,Apache启动正常,却无法访问localhost和127.0.0.1
  11. 【vue】vue +element 搭建项目,要求既支持pc端又支持移动端
  12. 媳妇要转java开发,我该怎么办?
  13. 【转】《深入理解C# 3.x的新特性》博文系列汇总
  14. [转]浅谈UML的概念和模型之UML九种图
  15. Xshell如何设置,当连接断开时保留Session,保留原文字
  16. forget word qz_c
  17. J05-Java IO流总结五 《 BufferedInputStream和BufferedOutputStream 》
  18. 使用socket发送http请求(get/post)
  19. r 数据分组处理
  20. MySql中存储过程的理解

热门文章

  1. 文本主题模型之LDA(二) LDA求解之Gibbs采样算法
  2. PHP导出生成excel文件
  3. 《Android进阶》之第六篇 Fragment 的使用2
  4. 解决R语言临时文件目录的问题(tempdir、tempfile)
  5. 微信小程序 支付功能(前端)的实现
  6. Oracle数据库------体系结构
  7. AngularJs 第三节随笔
  8. python——快速找出两个电子表中数据的差异
  9. 对于php内存释放问题
  10. 打印杨辉三角--for循环