相关的js:

var tmpRightTitle = {};
var titleIndex = 1;
$.post(rightUrl, function (data)
//data = $.parseJSON(data);
//console.log(data);
for (i = 0; i < data.length; i++) {
if (data[i].ParentSN == "") {
$('#umenu').tree('append', {
data: [{
parent: null,
text: data[i].Name,
id: data[i].SN,
tag: '',
iconCls: data[i].Image,
title:data[i].Remark
}]
});
tmpRightTitle[titleIndex] = data[i].SN;
titleIndex++;
(function ()//目前这个写法,只支持二级菜单,菜单数据由后台提供
var k = arguments[0];
//console.log(k.Children);
var sel = $('#umenu').tree('find', k.SN);
for (j = 0; j < k.Children.length; j++) {
var cnode = k.Children[j];
var url = rootPath + '/' + cnode.Controller + '/' + cnode.Action;
$('#umenu').tree('append', {
parent: sel.target,
data: [{
text: cnode.Name,
id: cnode.SN,
tag: url,
iconCls: cnode.Image,
title: cnode.Remark
}]
});
tmpRightTitle[titleIndex] = cnode.SN;
titleIndex++;
}
$('#umenu').tree('collapse', sel.target);
})(data[i])
}
}
});

umenu.tree({
onSelect: function (node)
if (node.state == 'closed') {
umenu.tree('expand', node.target);
node.state = 'open';
}
else {
umenu.tree('collapse', node.target);
node.state = 'closed';
}
},
onClick: function (node)
if (node.tag != "") {
change(node.text, node.tag);
}
},
onLoadSuccess: function (e, row)
addTreeTitle(row);//调用上面定义的方法
function addTreeTitle(row)
for (var key in tmpRightTitle) {
var title = $('#_easyui_tree_' + key);
var node = umenu.tree('find', tmpRightTitle[key]);
title.attr('title', node.title);
}
}

思路:在加载树的时候,记录下节点的序号,并给节点加上title属性,这个只是为后边的方法提供一下数据,在onLoadSuccess事件调用加title的方法,easyui生成的树代码如下:

<div id="_easyui_tree_1" class="tree-node"
<span class="tree-hit tree-collapsed"></span>
<span class="tree-icon tree-folder icon-root"></span>
<span class="tree-title">系统设置</span>
</div>

格式统一都是id 名:easyui_tree序号,因此通过找到这个div,给这个div加上title属性,就可以有鼠标提示了。