card布局解决复杂操作的布局问题
一直不是很待见直接使用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布局解决复杂操作的布局问题的更多相关文章
- 意外地解决了一个WPF布局问题
原文:意外地解决了一个WPF布局问题 今天做了一个小测试,意外地将之前的一个困扰解决了,原问题见<WPF疑难杂症会诊>中的“怎么才能禁止内容撑大容器?” 以前我是在外侧嵌套Canvas容器 ...
- D3.js系列——交互式操作和布局
一.图表交互操作 与图表的交互,指在图形元素上设置一个或多个监听器,当事件发生时,做出相应的反应. 交互,指的是用户输入了某种指令,程序接受到指令之后必须做出某种响应.对可视化图表来说,交互能使图表更 ...
- (转载)解决切换Fragment时布局重新实例化
解决切换Fragment时布局重新实例化 作者 instanceof 关注 2015.12.30 17:25* 字数 628 阅读 7616评论 17喜欢 23 关于Fragment 在这简单说一下F ...
- android 解决输入法键盘遮盖布局问题
/** * @param root 最外层布局,需要调整的布局 * @param scrollToView 被键盘遮挡的scrollToView,滚动root,使scrollToVie ...
- CSS3与页面布局学习总结——多种页面布局
一.负边距与浮动布局 1.1.负边距 所谓负边距就是margin取负值的情况,如margin:-40px:margin-left:-100%.当一个元素与另一个元素margin取负值时将拉近距离.常见 ...
- 布局管理器之CardLayout(卡片布局管理器)
对于选项卡这个概念大家可能不会陌生,就是在一个窗口中可以切换显示多页不同的内容,但同一时间只能是其中的某一页可见的,这样的一个个的页面就是选项卡. CardLayout就是类似的这样一个布局管理器,它 ...
- 图解CSS布局(一)- Grid布局
图解CSS布局(一)- Grid布局 先上图 简介 Grid 布局是将容器划分成"行"和"列",产生单元格,然后指定"项目所在"的单元格,可 ...
- 结合CSS3的布局新特征谈谈常见布局方法
写在前面最近看到<图解CSS3>的布局部分,结合自己以前阅读过的一些布局方面的知识,这里进行一次基于CSS2.3的各种布局的方法总结. 常见的页面布局 在拿到设计稿时,作为一个前端人员,我 ...
- 2021年3月-第02阶段-前端基础-Flex 伸缩布局-移动WEB开发_flex布局
移动web开发--flex布局 1.0 传统布局和flex布局对比 1.1 传统布局 兼容性好 布局繁琐 局限性,不能再移动端很好的布局 1.2 flex布局 操作方便,布局极其简单,移动端使用比较广 ...
随机推荐
- linux下突破10万高并发的nginx性能优化经验
一.这里的优化主要是指对nginx的配置优化,一般来说nginx配置文件中对优化比较有作用的主要有以下几项:1)nginx进程数,建议按照cpu数目来指定,一般跟cpu核数相同或为它的倍数.worke ...
- visual studio 2017下载地址
因为Visual studio 2017采用的是下载安装模式,所以下载比较慢,安装不方便.所以,这几天将下载过的visual studio 2017的文件打包成ISO文件并存到了百度网盘.希望对现在需 ...
- 分类问题的几个评价指标(Precision、Recall、F1-Score、Micro-F1、Macro-F1
轉自 https://blog.csdn.net/sinat_28576553/article/details/80258619 四个基本概念TP.True Positive 真阳性:预测为正,实 ...
- 《重构-改善既有代码的设计》学习笔记----Extract Method(提炼函数)
看见一个过长的函数或者需要一段注释才能让人理解的代码,可以考虑将这段代码放进一个独立函数中. 创造一个新的函数,根据这个函数的意图来对它命名(以它“做什么”来命名,而不是以它“怎么做”命名). 需要重 ...
- delphi 各版本的特性
delphi 各新版本特性收集 Delphi XE6新增了一些特性并增强了原有的功能,主要有以下几个方面: IDE(整合开发环境) Internet XML(扩展标记语言) Compiler( ...
- SQL脚本--总耗CPU最多的前个SQL --平均耗CPU最多的前个SQL
--总耗CPU最多的前个SQL SELECT TOP 20 total_worker_time/1000 AS [总消耗CPU 时间(ms)],execution_count [运行次数], qs.t ...
- leetcode 890. 查找和替换模式 Python
用模式的每个字母去当做key对应单词列表的每个字母value, 如果放进dict之前检测到key已经存在,就检测Word[i][j]是否是和已经存在的value一致,不一致就代表不匹配,break检查 ...
- linux中的查找命令find,locate,which,whereis
我们经常在linux要查找某个文件,但不知道放在哪里了,可以使用下面的一些命令来搜索.这些是从网上找到的资料,因为有时很长时间不会用到,当要用的时候经常弄混了. which 查看可执行文 ...
- DOM事件类
1.DOM中的事件级别 DOM0: element.onclick = function(){} DOM1: 没有与事件相关的设计 DOM2: element.addEventListener('cl ...
- 使用 Angular Console 提升开发体验
Angular Console Angular Console 是一个用于扩展 Angular CLI 的强大工具,通过提供一个图形界面的形式,方便开发者使用 CLI 的功能. Angular CLI ...