mirror of https://github.com/layui/layui
完善 treeTable 获取节点方法返回的节点对象信息,新增几个常用的节点方法方便调用
parent
fcfe5c2fed
commit
8e873dde1d
|
@ -372,6 +372,22 @@ layui.define(['table'], function (exports) {
|
|||
dataIndex: treeNodeData[LAY_DATA_INDEX],
|
||||
getParentNode: function () {
|
||||
return that.getNodeByIndex(treeNodeData[LAY_PARENT_INDEX])
|
||||
},
|
||||
update: function (data) {
|
||||
return treeTable.updateNode(tableId, index, data)
|
||||
},
|
||||
remove: function () {
|
||||
return treeTable.removeNode(tableId, index)
|
||||
},
|
||||
expand: function (opts) {
|
||||
return treeTable.expandNode(tableId, $.extend({}, opts, {
|
||||
index: index
|
||||
}))
|
||||
},
|
||||
setChecked: function (opts) {
|
||||
return treeTable.setRowChecked(tableId, $.extend({}, opts, {
|
||||
index: index
|
||||
}))
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue