///
///
Type.registerNamespace("nblf.ui");
nblf.ui.RadioList = function(id) {
this.id = id;
this.RepeatColumns = 0;
this.DataSource = new Array(); //接受一个数组对象
this.DataTextField = "";
this.DataValueField = "";
var My = this;
//绑定数据
this.DataBind = function() {
if (this.DataTextField == "") { alert("属性DataTextField不能为空"); return; }
if (this.DataValueField == "") { alert("属性DataValueField不能为空"); return; }
var html = new Sys.StringBuilder();
html.append("
");
$("#" + this.id).html(html.toString());
}
//取得所有元素
this.Items = function() {
return $("#" + this.id + " input");
}
//取得所有已选择元素
this.GetSelectItems = function() {
return $("#" + this.id + " input[checked]");
}
//设置元素选择
this.SelectDataValue = function(DataValue) {
$("#" + this.id + " input[value='" + DataValue + "']").attr("checked", true);
}
//设置元素选择
this.SelectDataText = function(DataText) {
$("#" + this.id + " input[text='" + DataText + "']").attr("checked", true);
}
//设置元素选择
this.UnSelectDataValue = function(DataValue) {
$("#" + this.id + " input[value='" + DataValue + "']").removeAttr("checked");
}
//设置元素选择
this.UnSelectDataText = function(DataText) {
$("#" + this.id + " input[text='" + DataText + "']").removeAttr("checked");
}
//清除选择
this.ClearSelectAll = function() {
$("#" + this.id + " input").removeAttr("checked");
}
}
nblf.ui.RadioList.registerClass('nblf.ui.RadioList', null);