search

Home  >  Q&A  >  body text

javascript - Problem with TreeGrid node moving up and down in EasyUI

//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");
    }
}
过去多啦不再A梦过去多啦不再A梦2788 days ago868

reply all(1)I'll reply

  • 阿神

    阿神2017-07-05 10:47:16

    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.

    reply
    0
  • Cancelreply