jQuery MiniUI
标题:
treeGrid新增数据,保存后怎么自动展开该节点路径
[打印本页]
作者:
white_star
时间:
2022-7-1 17:57:34
标题:
treeGrid新增数据,保存后怎么自动展开该节点路径
新增节点,ajax返回函数,此处reload后,下一行selectNode获取是undefined
success
: function
(
result
)
{
let
tgrid
=
mini
.
get
(
"dept_treetable"
)
;
treeGrid
.
reload
()
;
let
selectNode
=
tgrid
.
getSelectedNode
()
tgrid
.
expandPath
(
selectNode
)
;
}
但是相同的代码,在这里,selectNode能获取到,并且展开节点路径
success
: function
(
result
)
{
mini
.
get
(
loading
)
.
destroy
()
;
let
tgrid
=
mini
.
get
(
"areaTreeGrid"
)
;
tgrid
.
reload
()
;
let
selectNode
=
tgrid
.
getSelectedNode
()
tgrid
.
expandPath
(
selectNode
)
;
}
准备改成这样,应该怎么获取到新增的这条数据,并且展开该节点路径
treeGrid
.
on
(
"load"
, function
(
sender
)
{
let
selectNode
=
treeGrid
.
getSelectedNode
()
treeGrid
.
expandPath
(
selectNode
)
;
})
作者:
felt
时间:
2022-7-4 09:17:49
var selectId = "";
tree.on("select", function (e) {
if (e.record) {
var id = e.sender.idField;
selectId = e.record[id];
}
})
tree.on("load", function (sender) {
var node= tree.getNode(selectId);
tree.expandPath(node);
})
复制代码
欢迎光临 jQuery MiniUI (http://miniui.com/discuss/)
Powered by Discuz! X2