<script  type="text/jscript">
var WinXianCode;
function SearchGetXianLuF(Type)
{
if(!WinXianCode)
{
//创建窗体框
WinXianCode=new Ext.Window({
id:'WinXianCode',
width:,
height:,
closeAction:'hide',
autoScroll:true,
model:true,
items : [
new Ext.form.FormPanel({
frame:true,
defaultType:'textfield',
id:'c-form',
labelWidth :,
defaults:{width:},
})
],
title:'报价项目包含不包含项'
});
}
QuotedPriceView(Type);
//弹出窗体
WinXianCode.show('XianLuCode');
}
</script> <script type="text/javascript"> //报价数据加载
function QuotedPriceView(Type)
{
var QuotedPriceCheckboxItems = [];
Ext.MessageBox.wait('报价数据正在加载','请稍等...');
Ext.Ajax.request({
url:'QuotedPrice.aspx',
method : 'post',
success: function (r) {
Ext.MessageBox.hide();
var data = Ext.decode(r.responseText).QuotedPricelist;
if(data.length>)
{
//获取报价:开始
for(var i=;i<data.length;i++)
{
QuotedPriceCheckboxItems.push
({
id:'CheckBox'+data[i].name,
name:data[i].name,
boxLabel: data[i].boxLabel,
inputValue:data[i].inputValue,
listeners:{
check:function(el,checked){
var coninter=Ext.getCmp("QuotedPriceS");
if(coninter!=undefined)
{
var inter=coninter.items;
var xq=[];
for (var i = ; i < inter.length; i++)
{
if (inter!=null && inter.get(i).checked)
{
xq.push(inter.get(i).inputValue);
}
}
if(Type==)
{
//费用包含
Ext.getCmp("ratedetail").setValue(xq.join('\n')); }
if(Type==)
{
//费用不包含
Ext.getCmp("ratedetailno").setValue(xq.join('\n'));
}
}
}
}
});
}
//获取报价:结束 //定义多选的报价数组:开始
var checkGroup = new Ext.form.CheckboxGroup({
id:'QuotedPriceS',
xtype:'checkboxgroup',
fieldLabel:'报价',
width:,
columns:,
items:QuotedPriceCheckboxItems
});
//定义多选的报价数组:结束 //多选的容器:开始
var cbp = Ext.getCmp("c-form");
cbp.items.add(checkGroup);
cbp.show();
cbp.doLayout();
//多选的容器:结束
}
}
});
}
</script>

后台返回的json数据:

JArray jar = new JArray();
DataSet db_QuotedPrice = SPBll.Packages.getQuotedPrice();
foreach (DataRow row in db_QuotedPrice.Tables[].Rows)
{
jar.Add(new JObject(
new JProperty("name", row["id"].ToString()),
new JProperty("inputValue", row["cname"].ToString()),
new JProperty("boxLabel", row["cname"].ToString())
));
}
Response.Write(new JObject(new JProperty("QuotedPricelist", jar)));

Ext js中CheckBoxGroup的动态绑定的更多相关文章

  1. Ext JS中Button的一般使用

    Ext JS中Button按钮的显示,以及按钮的部分事件 一.属性 renderTo:将当前对象所生成的HTML对象存放在指定的对象中 text:得到按钮名称 minWidth:按钮最小宽度 hidd ...

  2. Ext JS中的typeOf

    Ext JS中的typeOf:以字符串格式,返回给定变量的类型 其中对字符串对象.元素节点.文本节点.空白文本节点判断并不准确 测试代码如下: <!DOCTYPE HTML PUBLIC &qu ...

  3. 【翻译】在Ext JS中创建特定主题的重写

    Ext JS提供了大量的功能来使类的创建和处理变得简单,还提供了一系列的功能来扩展和重新现有的Javascript类.这意味着可以为类添加行为和创建属于自己的类,或者重写某些函数的行为.在本文,将展示 ...

  4. Ext.js中的tip事件实际使用

    Ext.onReady(function () { // Init the singleton. Any tag-based quick tips will start working. Ext.ti ...

  5. Ext.js中自己扩展的EasyGrid

    这里只写了一些核心的代码,具体如下: Ext.ux.EasyGrid = Ext.extend(Ext.grid.GridPanel, { initComponent: function () { t ...

  6. Ext.js 中 25种类型的Ext.panel.Tool

    通过Ext.panel.Panel的tools配置项来设置Ext.panel.Tool实例. 要注意的一点是,Ext框架提供的Ext.panel.Tool仅包含按钮图标而具体的点击事件处理函数需要我们 ...

  7. Ext.js中树勾选的四种操作

    最近在做控件优化的时候产品提了一个需求,对树的勾选要满足四种勾选方案: 1.点击一次根节点,当根节点和子节点均未选中的情况下,根节点和子节点全都选中. 2.第二次点击根节点,当根节点和部分或全部子节点 ...

  8. 【翻译】在Ext JS和Sencha Touch中创建自己定义布局

    原文:Creating Custom Layouts in Ext JS and Sencha Touch 布局系统是Sencha框架中最强大和最独特的一部分.布局会处理应用程序中每个组件的大小和位置 ...

  9. 【翻译】在Ext JS和Sencha Touch中创建自定义布局

    原文:Creating Custom Layouts in Ext JS and Sencha Touch 布局系统是Sencha框架中最强大和最独特的一部分.布局会处理应用程序中每个组件的大小和位置 ...

随机推荐

  1. IE兼容CSS3圆角border-radius的方法(同时兼容box-shadow,text-shadow)

    IE兼容CSS3圆角border-radius,box-shadow,text-shadow的方法 1.下载ie-css3.htc 2.CSS box { -moz-border-radius: 15 ...

  2. android 根据SD卡中图片路径读取并显示SD中的图片——源代码

    package com.guo; import java.io.File; import android.app.Activity; import android.graphics.Bitmap; i ...

  3. Python 基础语法

    Python 基础语法 Python语言与Perl,C和Java等语言有许多相似之处.但是,也存在一些差异. 第一个Python程序 E:\Python>python Python 3.3.5 ...

  4. iOS开发——动画编程Swift篇&(三)CATransition动画

    CATransition动画 // MARK: - CATransition动画 // /* 动画样式 */ // let kCATransitionFade: NSString! //翻页 // l ...

  5. Category目录

    Category目录 目录 概述——对Category的理解 创建Category Category的用途 概述——对Category的理解 当我们想往原有的类中添加新的成员方法但又不想改变原有的类和 ...

  6. MySQL 调优基础:Linux内存管理 Linux文件系统 Linux 磁盘IO Linux网络

    http://www.cnblogs.com/digdeep/category/739915.html

  7. window.location.Reload()和window.location.href 区别

    首先介绍两个方法的语法: reload 方法,该方法强迫浏览器刷新当前页面.语法:location.reload([bForceGet])参数: bForceGet, 可选参数, 默认为 false, ...

  8. BinaryWriter和BinaryReader用法

      C#的FileStream类提供了最原始的字节级上的文件读写功能,但我们习惯于对字符串操作,于是StreamWriter和 StreamReader类增强了FileStream,它让我们在字符串级 ...

  9. python实现二叉树遍历算法

    说起二叉树的遍历,大学里讲的是递归算法,大多数人首先想到也是递归算法.但作为一个有理想有追求的程序员.也应该学学非递归算法实现二叉树遍历.二叉树的非递归算法需要用到辅助栈,算法着实巧妙,令人脑洞大开. ...

  10. php手册总结《安装与配置》

    一:web服务器与php解释器的连接方式 有两个方法将 PHP 连接到服务器上. 1>通过SAPI模块来连接 对于很多服务器,PHP 均有一个直接的模块接口(也叫做 SAPI).这些服务器包括 ...