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 ...
随机推荐
- [BZOJ4776] [Usaco2017 Open]Modern Art(差分 + 思维?)
传送门 可以预处理出每种颜色的上下左右的位置,这样就框出来了一个个矩形,代表每种颜色分别涂了哪里. 然后用二维的差分. 就可以求出来每个位置至少涂了几次,如果 > 1 的话,就肯定不是先涂的, ...
- 洛谷P3759 - [TJOI2017]不勤劳的图书管理员
Portal Description 给出一个\(1..n(n\leq5\times10^4)\)的排列\(\{a_n\}\)和数列\(\{w_n\}(w_i\leq10^5)\),进行\(m(m\l ...
- spring-Ioc容器与bean
1. spring 的beanFactory容器 bean.xml HelloWorld实体类与spring教程学习笔记1相同 public static void main(String[] ar ...
- 标准C程序设计七---06
Linux应用 编程深入 语言编程 标准C程序设计七---经典C11程序设计 以下内容为阅读: <标准C程序设计>(第7版) 作者 ...
- Laravel 之Cache缓存
写入缓存 Cache::put('key','value',10);//设置10分钟 获取缓存 Cache::get('key'); 增加缓存 Cache::add('key','value',10) ...
- ganglia-monitoring-centos-linux
http://www.tecmint.com/install-configure-ganglia-monitoring-centos-linux/ http://monitor.gitlab.net/ ...
- 你还在为移动端选择器picker插件而捉急吗?
http://www.cnblogs.com/jingh/p/6381079.html 开题:得益于项目的上线,现在终于有时间来写一点点的东西,虽然很浅显,但是我感觉每经历一次项目,我就学到了很多的东 ...
- 解决vs2005调试时出现未载入符号的问题
首先在以下的网址下载相应系统的符号包 http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx 下载完之后安装到一个文件夹比方D: ...
- BUPT复试专题—排序(2009)
题目描述 查找序列a 中小于 b 的第 i 个数的数的个数 输入 输入有多组,每组四行第一行:序列a个数N第二行:(序列a的)N个数,升序排列第三行:序列b个数M 第四行:(序列b的)M个数,升序排列 ...
- 【转】Code Your Own PHP MVC Framework in 1 Hour
原文: https://www.codeproject.com/Articles/1080626/Code-Your-Own-PHP-MVC-Framework-in-Hour --------- ...