gpt4 book ai didi

c# - 如何在JSTree中更改节点的新名称 "rename"

转载 作者:行者123 更新时间:2023-12-02 19:36:32 25 4
gpt4 key购买 nike

我正在尝试使用以下代码重命名节点,我需要将节点的 ID 和新名称传递给 server.aspx

如何获取节点的新名称

如何将这两个值传递到 server.aspx 页面

谢谢

   .bind("rename.jstree", function (e, data) {
data.rslt.obj.each(function () {
$.ajax({
async: false,
type: 'POST',
url: "./ajax/server.aspx",
data:
{
"operation": "rename_node",
"id": this.id
},
success: function (r) {
if (r == "-1") {
$.jstree.rollback(data.rlbk);
}
else {
$(data.rslt.oc).attr("id", "node_" + r.id);
if (data.rslt.cy && $(data.rslt.oc).children("UL").length) {
data.inst.refresh(data.inst._get_parent(data.rslt.oc));
}
}
}
});
});
})

最佳答案

  .bind("rename.jstree", function (e, data) {
data.rslt.obj.each(function () {
$.ajax({
async: false,
type: 'GET',
url: "./ajax/server.aspx",
data:
{
"operation": "rename",
"id": this.id,
"new_name" : data.rslt.new_name
},
success: function (r) {
if (r == "-1") {
$.jstree.rollback(data.rlbk);
}
else {
$(data.rslt.oc).attr("id", "node_" + r.id);
if (data.rslt.cy && $(data.rslt.oc).children("UL").length) {
data.inst.refresh(data.inst._get_parent(data.rslt.oc));
}
}
}
});
});

})

关于c# - 如何在JSTree中更改节点的新名称 "rename",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10878773/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com