TD - 多选框 - CheckBox

模板

模板1:TD

//Html - checked="true" 默认选中

<input dojoType="bootstrap.form.CheckBox" checked="true" dojoAttachPoint="assetsIdBox">

Js:

//绑定修改事件

this.connects.push(dojo.connect(this.isIntelligent, "onChange", this, this.onChange_isIntelligent));

onChange_isIntelligent: function(){

    if (this.isIntelligent.checked){//选中}else{//未选中}

}

//设置为选中

this.browseVideoBox.attr("checked", true);

//设置为不选中

this.browseVideoBox.attr("checked", false);

 

模板2:动态建立

var checkBox = new bootstrap.form.CheckBox({});

checkBox.id = json[i].id;

checkBox.caption = json[i].caption;

this.divLogType.appendChild(checkBox.domNode);

this.divLogType.appendChild(document.createTextNode(json[i].caption + " "));

 

模板3:动态建立 - 每行5个

html

<div class="row">
  <div class="col-lg-12" dojoAttachPoint="divLogType"></div>
</div>

js

var table = document.createElement("table");
this.divLogType.appendChild(table);
var tr = null;
var td = null;
dojo.forEach(json, dojo.hitch(this, function(item, idx){
  if (Math.floor(idx / 5) * 5 == idx) {
    tr = table.insertRow(-1); //兼容IE6
  }
  td = document.createElement("td");
  td.setAttribute("width", "200px");
  tr.appendChild(td);

  var checkBox = new bootstrap.form.CheckBox({});
  checkBox.logTypeId = item.id;
  checkBox.logTypeCaption = item.caption;
  td.appendChild(checkBox.domNode);
  td.appendChild(document.createTextNode(item.caption + " "));
}));

 

转载于:https://www.cnblogs.com/7q4w1e/p/9549353.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值