一直不是很待见直接使用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. Spring BOOT的学习笔记

    1,静态文件夹src/main/resources/static下的,图片必须放在images文件夹下才能访问,直接放在static下不能访问 2,配置热部署,否则修改下Html,图片都得重启 htt ...

  2. 创建一个dynamics 365 CRM online plugin (十) - Isolation mode or trust mode

    Isolation Mode 也被称作为Plugin Trust CRM里面有两种plugin trust / isolation mode 1. Full Trust 只在OP系统中可使用,没有限制 ...

  3. 深入理解CSS系列(二):为什么height:100%不生效?

    对于height属性,如果父元素height为auto,只要子元素在文档流中(即position不等于fixed或者absolute),其百分比值完全就被忽略了.这是什么意思呢?首先来看个例子,比如, ...

  4. 关于SVD

    下面的公式是基于物品的计算: 我之所以要把粘出来,是因为这种计算模式是公式界常用的一种方式:体会一下,单个来讲SiN*Run / |Sin|,分子分母公约之后只剩下了Run了:但是公式记录的是一种和运 ...

  5. python selenium-webdriver 执行js (八)

    使用python selenium 做自动化测试的时候其实我基本没有使用过执行js,只是在后来使用selenium来爬虫的时候使用到了,所以我在这里也就拿出来简单的介绍一下如何执行js. execut ...

  6. python ctypes库3_如何传递并返回一个数组

    可以将数组指针传递给dll,但无法返回数组指针,python中没有对应的数组指针类型. 如果需要返回数组,需借助结构体. 参考ctypes官方文档: https://docs.python.org/3 ...

  7. Spring中的接口BeanFactory和FactoryBean的学习

    BeanFactory: 相当于对象工厂,可以获取对象的实例以及相应的属性.BeanFactory定义了IOC容器的最基本形式,并提供了IOC容器应遵守的的最基本的接口,也就是Spring IOC所遵 ...

  8. C#工具类:Json操作帮助类(转载)

    原文转载自C#工具类:Json操作帮助类_IT技术小趣屋. Json序列化和反序列化在程序开发中时常会遇到,在C#中可以使用很多种方法实现对数据的Json序列化和反序列化,封装一个Json操作工具类来 ...

  9. 【springboot】之自动配置原理

    使用springboot开发web应用是很方便,只需要引入相对应的GAV就可以使用对应的功能,springboot默认会帮我们配置好一些常用配置.那么springboot是怎么做到的呢?这篇文章将一步 ...

  10. Camp 前三日简单总结

    1.#include <bits/stdc++.h> 后面别再忘了写 using namespace std; 2.在#include <bits/stdc++.h> 中 可以 ...