一直不是很待见直接使用card布局,直到对于一些稍微复杂点的业务,

通过border布局和弹窗体的方式解决特别费劲之后,才想起了card布局,

发现card布局真是一个很好的解决办法。

那个使用起来很简单,对于里面的每一个页签,我们都要设置好一个itemId,

这样就可以   setActiveItem( ) 方法来限制展现哪个卡片了。

对于card布局,只要知道用这个方法就足够了。

设置一下itemId属性。

        zhuUx.centerContainer = Ext.create('Ext.container.Container', {
region: 'center',
items: [zhuUx.luxianGrid, zhuUx.yinhuanLuduanGrid, zhuUx.editor],
layout: 'card'
}); zhuUx.luxianNextAction = Ext.create('Ext.Action', {
scope: zhuUx,
tooltip: '下一步',
scale: 'medium',
handler: zhuUx.onLuxianNextAction,
text: '下一步'
}); zhuUx.yinhuanLuduanNextAction = Ext.create('Ext.Action', {
scope: zhuUx,
tooltip: '下一步',
scale: 'medium',
handler: zhuUx.onYinhuanLuduanNextAction,
text: '下一步'
}); zhuUx.yinhuanLuduanPreAction = Ext.create('Ext.Action', {
scope: zhuUx,
tooltip: '上一步',
scale: 'medium',
handler: zhuUx.onYinhuanLuduanPreAction,
text: '上一步'
}); zhuUx.editorPreAction = Ext.create('Ext.Action', {
scope: zhuUx,
tooltip: '上一步',
scale: 'medium',
handler: zhuUx.onEditorPreAction,
text: '上一步'
}); zhuUx.createAction = Ext.create('Ext.Action', {
scope: zhuUx,
tooltip: '新增',
scale: 'medium',
handler: zhuUx.onSaveAnfangJihuaAction,
text: '新增'
}); zhuUx.cancelAction = Ext.create('Ext.Action', {
scope: zhuUx,
tooltip: '取消',
scale: 'medium',
handler: zhuUx.onCancelAction,
text: '取消'
}); var actionBtns = [zhuUx.yinhuanLuduanPreAction, zhuUx.editorPreAction,
zhuUx.luxianNextAction, zhuUx.yinhuanLuduanNextAction,
zhuUx.createAction, zhuUx.cancelAction]; zhuUx.currentAddWin = Ext.create('Ext.window.Window', {
title: Ext.String.format("新增{0}", zhuUx.mainItemCName),
overflowY: 'auto', layout: "border",
width: sintoon.get200Width(),
height: sintoon.get200Height(),
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
layout: {
defaultMargins: {
right:
},
pack: "center"
},
items: actionBtns
}],
items: [zhuUx.centerContainer]
}) zhuUx.SetWindowState("luxianGrid"); SetWindowState: function (newstate) {
var zhuUx = this;
if (newstate == "luxianGrid") {
zhuUx.currentAddWin.setTitle("1:选择路线");
zhuUx.yinhuanLuduanPreAction.hide();
zhuUx.editorPreAction.hide();
zhuUx.luxianNextAction.show();
zhuUx.yinhuanLuduanNextAction.hide();
zhuUx.createAction.hide(); zhuUx.centerContainer.getLayout().setActiveItem(newstate);
}
else if (newstate == "yinhuanLuduanGrid") {
zhuUx.currentAddWin.setTitle("2:选择隐患路段");
zhuUx.yinhuanLuduanPreAction.show();
zhuUx.editorPreAction.hide();
zhuUx.luxianNextAction.hide();
zhuUx.yinhuanLuduanNextAction.show();
zhuUx.createAction.hide(); zhuUx.centerContainer.getLayout().setActiveItem(newstate);
}
else if (newstate == "editor") {
zhuUx.currentAddWin.setTitle("3:填写计划信息");
zhuUx.yinhuanLuduanPreAction.hide();
zhuUx.editorPreAction.show();
zhuUx.luxianNextAction.hide();
zhuUx.yinhuanLuduanNextAction.hide();
zhuUx.createAction.show(); zhuUx.centerContainer.getLayout().setActiveItem(newstate);
}
}

card布局解决复杂操作的布局问题的更多相关文章

  1. 意外地解决了一个WPF布局问题

    原文:意外地解决了一个WPF布局问题 今天做了一个小测试,意外地将之前的一个困扰解决了,原问题见<WPF疑难杂症会诊>中的“怎么才能禁止内容撑大容器?” 以前我是在外侧嵌套Canvas容器 ...

  2. D3.js系列——交互式操作和布局

    一.图表交互操作 与图表的交互,指在图形元素上设置一个或多个监听器,当事件发生时,做出相应的反应. 交互,指的是用户输入了某种指令,程序接受到指令之后必须做出某种响应.对可视化图表来说,交互能使图表更 ...

  3. (转载)解决切换Fragment时布局重新实例化

    解决切换Fragment时布局重新实例化 作者 instanceof 关注 2015.12.30 17:25* 字数 628 阅读 7616评论 17喜欢 23 关于Fragment 在这简单说一下F ...

  4. android 解决输入法键盘遮盖布局问题

    /**     * @param root 最外层布局,需要调整的布局     * @param scrollToView 被键盘遮挡的scrollToView,滚动root,使scrollToVie ...

  5. CSS3与页面布局学习总结——多种页面布局

    一.负边距与浮动布局 1.1.负边距 所谓负边距就是margin取负值的情况,如margin:-40px:margin-left:-100%.当一个元素与另一个元素margin取负值时将拉近距离.常见 ...

  6. 布局管理器之CardLayout(卡片布局管理器)

    对于选项卡这个概念大家可能不会陌生,就是在一个窗口中可以切换显示多页不同的内容,但同一时间只能是其中的某一页可见的,这样的一个个的页面就是选项卡. CardLayout就是类似的这样一个布局管理器,它 ...

  7. 图解CSS布局(一)- Grid布局

    图解CSS布局(一)- Grid布局 先上图 简介 Grid 布局是将容器划分成"行"和"列",产生单元格,然后指定"项目所在"的单元格,可 ...

  8. 结合CSS3的布局新特征谈谈常见布局方法

    写在前面最近看到<图解CSS3>的布局部分,结合自己以前阅读过的一些布局方面的知识,这里进行一次基于CSS2.3的各种布局的方法总结. 常见的页面布局 在拿到设计稿时,作为一个前端人员,我 ...

  9. 2021年3月-第02阶段-前端基础-Flex 伸缩布局-移动WEB开发_flex布局

    移动web开发--flex布局 1.0 传统布局和flex布局对比 1.1 传统布局 兼容性好 布局繁琐 局限性,不能再移动端很好的布局 1.2 flex布局 操作方便,布局极其简单,移动端使用比较广 ...

随机推荐

  1. Go 知识点

    必须在源文件中非注释的第一行指明这个文件属于哪个包,如:package main. package main表示一个可独立执行的程序,每个 Go 应用程序都包含一个名为 main 的包. main 函 ...

  2. html 出现粒子线条,鼠标移动会以鼠标为中心吸附的特效之canvas-nest.js插件

    我在网上看到一个很炫酷,很有趣的特效,网页上会有很多移动的粒子和线条,鼠标经过时会以鼠标为中心吸附过来,如果时间够久,会形成一个类似震动的.带辐条的车轮子的东西. 网上搜了一下,源码是github里面 ...

  3. cocos2dx lua invalid 'cobj' in function 'lua_cocos2dx'

    解决方法 在创建 Node节点后 调用父节点 retain() 方法 手动增加引用 一般调用:clone()方法会出现,在变量后面加上对一个对应的retain() 方法

  4. 新ubuntu系统装软件

    新装的ubuntu系统安装软件: 1.ifconfig #sudo apt-get install net-tools 2.vim #sudo apt-get install vim 3.telnet ...

  5. HTML 理解标签 - meta

    meta标签 , 常用的有以下几个属性: 1. name : 比较常见的一些属性 author: 就是这个文档的作者名称,可以用自由的格式去定义 description: 包括一个关于页面内容的缩略而 ...

  6. MFC 单文档调用对话框

    1.插入新的Dialog,如下图: 2.修改ID位 IDD_XMB 3.在单文件的Menu 中选中需要链接的按键,右键添加处理程序,如下图所示,添加完成后,在项目的xxxview.cpp中会生成如下函 ...

  7. WCF服务could not be activated

    The requested service, 'http://10.10.10.143/XmlEditorService/XmlEditorService.svc' could not be acti ...

  8. Oracle数据库ORA-01109 数据库未打开

    引致 https://blog.csdn.net/colinmok/article/details/39504879?locationNum=11&fps=1  感谢! 在plsql创建了2表 ...

  9. springBoot的第一个程序

    创建一个springBoot工程 然后输入工程名字 然后选择要导入的依赖jar包,这里只勾选了web 然后目录结构 创建一个controller必须在aplication.properties的同级目 ...

  10. Ping 笔记

    Ping  笔记 查看网络间的连通性. 当设备与PC在同一局域网中(连接同一路由器),设备与PC互Ping对方,若只有其中一个掉线连不上,两者可能存在网络端口的问题, 若设备与PC同时掉线,则为路由器 ...