easyui treegrid 获取父节点,运行到js报错?代码下

<th data-options="field:'parentSubjectName',width:100,editor:'text',formatter:function(value,row,index){
console.log(row.parentSubjectCode);
var lv = $('#tg').treegrid('getParent', row.parentSubjectCode);
console.log(lv);

}">上级科目</th

报错:
VM494 jquery.easyui.min.js:2157 Uncaught TypeError: Cannot read property 'data' of undefined(…)

这个js怎么报错呢?图片说明

怎么回事呢,来大神帮忙啊

一般这种情况还是因为你的代码写错了。传进去的参数不是个节点吧。 row.parentSubjectCode只是拿到一个值而已,你要传进去的是个node.target