extjs 4 checkboxgroup Panel的简单用法
Ext.require([
'Ext.tree.*',
'Ext.data.*',
'Ext.window.MessageBox',
'Ext.tip.*'
]); Ext.onReady(function() {
/* new Ext.Window({
title:"新增",
width:500,
height:400,
plain:true,
layout:"form",
labelWidth:55,
items:[{
layout:"column",
baseCls:"x-plain",
style:"padding:5px",
items:[{
columnWidth:.5,
layout:"form",
labelWidth:50,
baseCls:"x-plain",
items:[{
xtype:"textfield",
fieldLabel:"姓名"
},{
xtype:"textfield",
fieldLabel:"姓名"
},{
xtype:"textfield",
fieldLabel:"姓名"
},{
xtype:"textfield",
fieldLabel:"姓名"
}]
},{
columnWidth:.5,
layout:"form",
items:[{
id:"name",
xtype:"textfield",
fieldLabel:"照片",
inputType:"image",
width:250,
height:50
}]
}]
},{
xtype:"textfield",
fieldLabel:" 证号"
}],
buttons:[{text:"确定"},{text:"取消"}]
}).show(); */ Ext.create('Ext.panel.Panel',{
title:'panel',
layout:'column',
frame:true,
height:300,
width:1000,
renderTo:Ext.getBody(),
defaults: {
// labelAlign: 'top',
baseCls:"x-plain",
padding:'5,10,5,10'
},
items:[{
columnWidth:.2,
frame:true, defaults: {
// labelAlign: 'top',
labelWidth:50
},
items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
},{
columnWidth:.2,
frame:true,
items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
},{
columnWidth:.2,
frame:true, items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
},{
columnWidth:.2,
frame:true, items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
},{
columnWidth:.2,
frame:true, items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
}] }); Ext.create('Ext.panel.Panel',{
title:'panel',
layout:'column',
frame:true,
height:300,
width:1000,
renderTo:Ext.getBody(),
defaults: {
// labelAlign: 'top',
baseCls:"x-plain",
padding:'5,10,5,10'
},
items:[{
columnWidth:.2,
frame:true, defaults: {
// labelAlign: 'top',
labelWidth:50,
height:20
},
items:[{
xtype:"checkbox",
boxLabel:"姓名3"
},{
xtype:"checkbox",
boxLabel:"姓名3"
},{
xtype:"checkbox",
boxLabel:"姓名3"
},{
xtype:"checkbox",
boxLabel:"姓名3"
}]
},{
columnWidth:.2,
frame:true,
items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
},{
columnWidth:.2,
frame:true, items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
},{
columnWidth:.2,
frame:true, items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
},{
columnWidth:.2,
frame:true, items:[{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
},{
xtype:"textfield",
fieldLabel:"姓名3"
},{
xtype:"textfield",
fieldLabel:"姓名4"
}]
}] }); var myPanel = Ext.create('Ext.form.Panel', {
title: 'Checkbox Group',
width: 850,
height: 125,
bodyPadding: 10,
renderTo: Ext.getBody(),
items:[{
xtype: 'checkboxgroup',
id:'mygroup',
fieldLabel: 'Two Columns',
columns: 6,
vertical: true,
items: [{
vertical: false,
// columnWidth:200,
xtype: 'panel',
baseCls:"x-plain",
items:[{
name:"moduleck",xtype: 'checkbox',boxLabel: 'Item 1', name: 'rb', inputValue: '111a'
},{
name:"moduleck", xtype: 'checkbox',boxLabel: 'Item 1-2', name: 'rb', inputValue: '111b'
},{
name:"moduleck",xtype:"checkbox",
boxLabel:"姓名3"
}
]},
{ boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true },
{ boxLabel: 'Item 3', name: 'rb', inputValue: '3' },
{ boxLabel: 'Item 4', name: 'rb', inputValue: '4' },
{ boxLabel: 'Item 5', name: 'rb', inputValue: '5' },
{ boxLabel: 'Item 6', name: 'rb', inputValue: '6' }
]
}]
});
Ext.create('Ext.Button', {
text: '得到被选中的节点',
renderTo: Ext.getBody(),
handler: function() {
var myCheckboxGroup = Ext.getCmp('#mygroup'); console.info('---'+myPanel.down('checkboxgroup').getId());
console.info('---'+myPanel.down('checkboxgroup').fieldLabel); console.info('---+myPanel.query("checkbox"):'+myPanel.query("checkbox")[0].name); console.info('---+myPanel.query("checkbox[name=rb]")'+myPanel.query("checkbox[name=rb]")[0].name);
var cks = myPanel.query("checkbox[name=rb]");
for(var i=0;i<cks.length;i++){
console.info("gg:"+cks[i].inputValue+","+cks[i].getValue());
cks[i].setValue(true);
}
console.info('---'+myPanel.down('checkbox').name);
console.info('---'+myPanel.down('checkbox').inputValue); return;
console.info( Ext.query("#mygroup").length);
console.info((Ext.query("#mygroup")[0]).getXType());
console.info( (Ext.query("#mygroup")[0]).getId()); return;
for (var i = 0; i < myCheckboxGroup.items.length; i++)
{
if (myCheckboxGroup.items.itemAt(i).checked)
{
console.info(Ext.isEmpty(myCheckboxGroup.items.itemAt(i).name));
alert();
}
}
}
}); });
extjs 4 checkboxgroup Panel的简单用法的更多相关文章
- CATransition(os开发之画面切换) 的简单用法
CATransition 的简单用法 //引进CATransition 时要添加包“QuartzCore.framework”,然后引进“#import <QuartzCore/QuartzCo ...
- jquery.validate.js 表单验证简单用法
引入jquery.validate.js插件以及Jquery,在最后加上这个插件的方法名来引用.$('form').validate(); <!DOCTYPE html PUBLIC " ...
- NSCharacterSet 简单用法
NSCharacterSet 简单用法 NSCharacterSet其实是许多字符或者数字或者符号的组合,在网络处理的时候会用到 NSMutableCharacterSet *base = [NSMu ...
- [转]Valgrind简单用法
[转]Valgrind简单用法 http://www.cnblogs.com/sunyubo/archive/2010/05/05/2282170.html Valgrind的主要作者Julian S ...
- Oracle的substr函数简单用法
substr(字符串,截取开始位置,截取长度) //返回截取的字 substr('Hello World',0,1) //返回结果为 'H' *从字符串第一个字符开始截取长度为1的字符串 subst ...
- Ext.Net学习笔记19:Ext.Net FormPanel 简单用法
Ext.Net学习笔记19:Ext.Net FormPanel 简单用法 FormPanel是一个常用的控件,Ext.Net中的FormPanel控件同样具有非常丰富的功能,在接下来的笔记中我们将一起 ...
- TransactionScope简单用法
记录TransactionScope简单用法,示例如下: void Test() { using (TransactionScope scope = new TransactionScope()) { ...
- WPF之Treeview控件简单用法
TreeView:表示显示在树结构中分层数据具有项目可展开和折叠的控件 TreeView 的内容是可以包含丰富内容的 TreeViewItem 控件,如 Button 和 Image 控件.TreeV ...
- listActivity和ExpandableListActivity的简单用法
http://www.cnblogs.com/limingblogs/archive/2011/10/09/2204866.html 今天自己简单的总结了listActivity和Expandable ...
随机推荐
- 通过new ClasspathApplicationContext("applicationContext.xml")找不到文件时
可以把applicationContext.xml放到/WEB-INF/classes目录下使用先说:ClassPathXmlApplicationContext 这个类,默认获取的是WEB-INF/ ...
- Count on a tree(bzoj 2588)
Description 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权.其中lastans是上一个询问的答案,初始 ...
- 【BZOJ3450】Easy(期望)
题意: 某一天WJMZBMR在打osu~~~但是他太弱逼了,有些地方完全靠运气:(我们来简化一下这个游戏的规则有n次点击要做,成功了就是o,失败了就是x,分数是按comb计算的,连续a个comb就有a ...
- mysql合并和时间函数
sql:利用group_concat()方法,参数为需要合并的字段,合并的字段分隔符默认为逗号,可通过参数separator指定,该方法往往配合group by 一起使用.利用group_concat ...
- ThinkPHP5.1入门
ThinkPHP5.1入门 ===================================Composer的官方网站:https://www.phpcomposer.com/========= ...
- 湘潭oj1203/邀请赛A题 数论+java大数
求 n%1+n%2+n%3+n%4+.........n%n=,n<=10^12次. 开始时盲目地找规律,结果一无所获.后来经学长点拨,天资愚钝,搞了半天才明白. 先上图: 对于该题,在求区间( ...
- graphviz的使用
安装:brew install graphviz 使用:dot -Tpng *.dot -o *.png 把dot文件转换为图片,* 换成具体的文件名, 这样你就成功的用脚本渲染出你要绘制的图片啦 参 ...
- jquery 常用选择器 回顾 ajax() parent() parents() children() siblings() find() eq() has() filter() next()
1. $.ajax() ajax 本身是异步操作,当需要将 异步 改为 同步时: async: false 2.parent() 父级元素 和 parents() 祖先元素 的区别 parent ...
- evaluate-reverse-polish-notation——栈
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*, ...
- Eclipse中移除native层编译支持
1. .project 文件 删除全部包括 org.eclipse.cdt前缀的xml结点元素.以下是一个包括cdt的完整编译配置文件. <?xml version="1.0" ...