//TreeGrid里面实现节点上下移动功能的代码片段
//有点不理解这段代码的意思、求解啊
//主要是不懂 .Prev("") 和 .attr("") 的意思
var _pvid = $("tr[node-id='" + row.Id + "']").prev("tr").attr("node-id");
if (!_pvid) {
if ($("tr[node-id='" + row.Id + "']").prev("tr").attr("class") == "treegrid-tr-tree") {
_pvid = $("tr[node-id='" + row.Id + "']").prev("tr").prev("tr").attr("node-id");
}
}
Prev and attr are both Jquery methods. The method names are abbreviations of words, namely previous and attribute respectively.
The name means: Prev is the adjacent previous node, and attr is the attribute of the JQuery object.