标题: function treegrid如何实现disable? [打印本页] 作者: bamboo0502 时间: 2014-8-15 11:09:19 标题: function treegrid如何实现disable?
以下是API中function treegrid的生成代码
function ondrawcell(e) {
var tree = e.sender,
record = e.record,
column = e.column,
field = e.field,
id = record[tree.getIdField()],
funs = record.functions;
function createCheckboxs(funs) {
if (!funs) return "";
var html = "";
if (showAllSelect) {
var value = record.checkAll !== false ? "全选" : "取消";
var clickFn = 'checkAllFunc(\'' + id + '\', this)';
html += '<input type="button" value="' + value + '" style="border:solid 1px #aaa;"/>';
}
for (var i = 0, l = funs.length; i < l; i++) {
var fn = funs[i];
var clickFn = 'checkFunc(\'' + id + '\',\'' + fn.action + '\', this.checked)';
var checked = fn.checked ? 'checked' : '';
html += '<label class="function-item"><input ' + checked + ' type="checkbox" name="'
+ fn.action + '" hideFocus/>' + fn.name + '</label>';
}
return html;
}
if (field == 'functions') {
e.cellHtml = createCheckboxs(funs);
}
}