TD

基本方法

Html - 默认选中

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

<input dojoType="bootstrap.form.RadioButton" value="1" checked="true" dojoAttachPoint="chkAreaAndDeptType">

Js - 取值

值为true,即为选中

var chkDeptType = this.chkDeptType.attr("checked");

if (this.RbtnUserAll.checked == true){}

Js - 设置为选中

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

this.RbtnUserAll.attr("value",true);

模板

模板1:

Html - 相同的name,只会有一个被选中

<!-- 设备 -->

<input dojoType="bootstrap.form.RadioButton" value="1" checked="true" dojoAttachPoint="equipmentBox" name="associationTypes"> ${nls.EQUIPMENT}

<!-- 交通设施 -->

<input dojoType="bootstrap.form.RadioButton" value="0" dojoAttachPoint="facilityBox" name="associationTypes"> ${nls.TRAFFIC_FACILITY}

JS

this.connects.push(dojo.connect(this.equipmentBox, "onChange", this, this.onChange_btnStart));

onChange_btnStart:function(){

  if(this.btnStart.checked){

    this.edtUrl.attr("disabled", false);

    this.btnSyncUser.attr("disabled", false);

  }else{

    this.edtUrl.attr("disabled", true);

    this.btnSyncUser.attr("disabled", true);

  }
},

 

原文地址:https://www.cnblogs.com/7q4w1e/p/9549345.html