<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. C++学习笔记之迭代器

    模板是的算法独立于存储的数据类型,而迭代器使算法独立于使用的容器类型.理解迭代器是理解STL的关键. 迭代器应该具备的特征: (1)应该能够对迭代器进行解除引用的操作,以便能够访问它引用的值.即如果P ...

  2. jQuery进行DOM操作记录

    1.在元素内部插入DOM元素 ①插入到元素内部原有元素之后 append(content)      返回值:jQuery  参数-content:要插入的元素String,Element,jQuer ...

  3. jquery 3D 标签云

    http://www.gbin1.com/technology/jquerynews/20111205tagcloudbyjquery/index.html 相关选项 zoom: 90 初始的缩放度  ...

  4. BZOJ 1083: [SCOI2005]繁忙的都市 kruskal

    1083: [SCOI2005]繁忙的都市 题目连接: http://www.lydsy.com/JudgeOnline/problem.php?id=1083 Description 城市C是一个非 ...

  5. Codeforces Round #311 (Div. 2) E. Ann and Half-Palindrome 字典树/半回文串

    E. Ann and Half-Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contes ...

  6. SexyProgressBar

    https://github.com/sunalong/SexyProgressBar

  7. asp.net 后台获取flv视频地址进行播放【转】

    源码下载:http://download.csdn.net/detail/njxiaogui/7609687 前台:.aspx <table> <tr> <td>& ...

  8. [ES6] 12. Shorthand Properties in ES6

    Where destructuring in ES6 allows you to easily get properties out of an object, this shorthand prop ...

  9. window.onload与$.ready的差别

    在做图书管理系统的时候.实用到window.onload(){}方法.可是遇到了一个问题.就是怎么都不运行,究竟是为什么呢?愁了半天.后来经师姐指点改用了$.ready(){}. 在我的浅浅的了解中觉 ...

  10. iOS开发——UI篇Swift篇&玩转UItableView(二)高级功能

    UItableView高级功能 class UITableViewControllerAF: UIViewController, UITableViewDataSource, UITableViewD ...