一直不是很待见直接使用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. 使用User Primary Email作为GUID的问题

    最近发现有人使用CRM的user primary email作为GUID, 并且做了plugin来控制user primary email. 这样做法是非常有问题而且会影响同名的再次注册的用户. 假如 ...

  2. 12 个 JS 技巧

    1. 过滤唯一值 ES6 引入了 Set 对象和延展(spread)语法…,我们可以用它们来创建一个只包含唯一值的数组. 复制代码     const array = [1, 1, 2, 3, 5, ...

  3. MySQL常用命令(数据库,表相关的命令)

    数据库相关命令 显示数据库列表 mysql> SHOW  DATABASES; 创建数据库 mysql> CREATE  DATABASE  库名; 如下,创建一个名为crashcours ...

  4. sqlhelper类,C#事务入库

    sql公共类: namespace Job.Common { public enum DataOption { Select = , Create, Update, Delete, Login } p ...

  5. Azure CosmosDB (6) 冲突类型和解决策略

    <Windows Azure Platform 系列文章目录> 当我们为CosmosDB配置多个Azure Region写入,就需要考虑冲突类型和解决策略. 对于配置了多个写入区域的 Az ...

  6. [转]Windows 经验集

    Windows Server 2012 R2 显示 这台电脑 图标方法: 来自:https://jingyan.baidu.com/article/f25ef2544f6883482c1b82e5.h ...

  7. 基于STM8的IIC协议---STM8-第五章

    1. 综述 I2C(IIC,Inter-Integrated Circuit),两线式串行总线,由PHILIPS公司开发用于连接微控制器及其外围设备. 它是由数据线SDA和时钟SCL构成的串行总线,可 ...

  8. DP基础练习(4.21)

    数塔 Description 在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? ...

  9. Difference between hash() and id()

    https://stackoverflow.com/questions/34402522/difference-between-hash-and-id There are three concepts ...

  10. ECMAScript 6 新特性-set。const

    一.let命令是es6新增的特性,作用与var命令类似,声明变量,不同之处在于声明的变量的作用域为块级作用域.引入let后带来了很多新的特性. 1作用域,es5之前之后函数作用域和全局作用域,let的 ...