EasyUI treegrid  加载checked

  $(function () {
$('#tbDictContTree').treegrid({
title: '数据字典目录管理',
iconCls: 'icon-ok',
//width: 700,
//height: 500,
fit: true, ////自动大小
rownumbers: true, //添加一列来显示行号
animate: true,
striped: true, //True 奇偶行使用不同背景色
collapsible: true,
//checkbox: true,
fitColumns: true,
url: '/ashx/Systems/tbDictContTree.ashx',
idField: 'pid',
treeField: 'sn',
// collapse: false,
// collapseAll: true,
//SELECT PID as pid, FID, SN as sn, Name as name, CanUse, Memo
columns: [[
//{ field: 'ck', checkbox: true }, //第一列显示选择
{ title: '编号', field: 'sn', width: },
{ title: '名称', field: 'name', width: },
// { title: '是否使用', field: 'canuse1', width: 180 },
{title: '是否使用', field: 'canuse', width: , align: 'center', formatter: function (value, row, index) {
if (row.canuse == "True") {
// return '<input type="checkbox" name="canuse" checked="checked">';
return '<img src="/images/checkmark.gif">';
}
else {
// return '<input type="checkbox" name="canuse" >';
return '<img src="/images/checknomark.gif">';
}
}
}, { title: '备注', field: 'memo', width: }
]],
queryParams: { "action": "query"} //传输参数
});
});
    function edit_dg1() {
//选中一行,获取这一行的属性的值
var node = $('#tbDictContTree').treegrid('getSelected');
//判断是否选中
if (node != null) {
$("#textpid").val(node.pid);
$("#textsn").val(node.sn);
$("#textname").val(node.name);
// $("#textcanuse").val(node.canuse);
if (node.canuse == "True")
$('#textcanuse').attr('checked',true); //checked;unchecked
else
$('#textcanuse').attr('checked', false);
$("#textmemo").val(node.memo);
$("#dd2").show(); //显示修改窗体
05-07 15:46