87,910
社区成员
发帖
与我相关
我的任务
分享
function inittreegrid() {
$('#tg').treegrid({
iconCls: 'icon-ok',
rownumbers: true,
animate: true,
collapsible: true,
fitColumns: true,
method: 'get',
idField: 'fid',
treeField: 'fname',
onContextMenu: onContextMenu,
onDblClickRow: function (rowIndex, rowData){
edit();
},
columns : [ [ {
field : 'fname',
title : '菜单名称',
width : 150,
align : 'center'
}, {
title : '菜单编码',
field : 'fid',
width : 100,
align : 'center'
},
{
field : 'level',
title : '菜单等级 ',
width : 80,
align : 'center'
} , {
field : 'icon',
title : '菜单图标 ',
width : 100,
align : 'center'
}, {
field : 'isleafstr',
title : '叶子菜单 ',
width : 80,
align : 'center'
}, {
field : 'titlename',
title : '选项卡名称 ',
width : 100,
align : 'center'
}, {
field : 'url',
title : 'action名 ',
width : 100,
align : 'center'
}, {
field : 'type',
title : '类型 ',
width : 100,
align : 'center'
}, {
field : 'bm',
title : '关联表名 ',
width : 100,
align : 'center'
}
, {
field : 'descr',
title : '说明 ',
width : 100,
align : 'center'
}
] ]
});
}
function settreevalue()
{
func.getFuncTreeJson(function(res)
{
if(res.success)
{
$('#tg').treegrid("loadData", res.jsonArray);
}
});
}
function edit(){
alert(0);
if (editingId != undefined){
alert(null);
$('#tg').treegrid('select', editingId);
return;
}
alert(2);
var row = $('#tg').treegrid('getSelected');
if (row){
editingId = row.fid;
alert(row.fid);
$('#tg').treegrid('beginEdit', editingId);
}
}