$(‘#resourceTree‘).tree({ method : ‘post‘, animate : true, onContextMenu : function(e, node) { e.preventDefault(); $(this).tree(‘select‘, node.target); $(‘#resourceContextMenu‘).menu(‘show‘, { left : e.pageX, top : e.pageY }); }, formatter : function(node) { // 格式化节点名称 var nodeText = node.text; if (node.attribute.resType == ‘2‘) { // 权限 nodeText += "(" + node.attribute + permission + ")"; } if (node.attribute.isValid == ‘0‘) { // 权限 nodeText = "<font color=‘blue‘>" + nodeText + "</font>"; } return nodeText; } });
原文:http://www.cnblogs.com/huiy/p/7747363.html