请参考jsfiddle:http: //jsfiddle.net/jLmm2/3/
{
key: "CustomeCheckbox",
label: "<input type='checkbox' id='SelectAll'> Select<br/>All",
formatter: function (elCell, oRecord, oColumn, oData) {
if (status == 'on') {
elCell.innerHTML = '<input type="checkbox" name="TRANSFER" ></input>';
} else {
elCell.innerHTML = '<input type="checkbox" name="TRANSFER" disabled="true" ></input>';
}
}
我有一个自定义格式的复选框:CustomeCheckbox 和一个标准复选框:在我的数据表中选择:容器
问题是 CustomeCheckbox,在尝试对表格进行排序时不记得选中状态。
你能帮我吗?谢谢
我已更新 YUI 以在选中复选框的情况下更新底层记录集。标准复选框按要求运行,但自定义格式化复选框仍未保留状态
dt.subscribe('checkboxClickEvent', function(oArgs) {
var elCheckbox = oArgs.target;
var elRecord = this.getRecord(elCheckbox); //record of the coloumn
var elColumn = this.getColumn(elCheckbox);
var name = elRecord.getData("Select1"); // Data in that record for the field
//alert("Checkbox was " + (elCheckbox.checked ? "" : "un") + "checked for " + name);
//alert(elCheckbox.checked);
this.getRecordSet().updateKey(elRecord, elColumn.key, elCheckbox.checked);
});