This commit is contained in:
yumoqing 2025-01-16 23:02:15 +08:00
parent fc5b07c82b
commit b0061cd6f5

View File

@ -269,8 +269,12 @@ bricks.Tree = class extends bricks.VScrollPanel {
var node = this; var node = this;
if (this.selected_node){ if (this.selected_node){
node = this.selected_node; node = this.selected_node;
if (d instanceof FormData){
d.append(this.parentField, node.get_id());
} else {
d[this.parentField] = node.get_id(); d[this.parentField] = node.get_id();
} }
}
if (this.editable.add_url){ if (this.editable.add_url){
var jc = new bricks.HttpJson() var jc = new bricks.HttpJson()
var desc = await jc.post(this.editable.add_url, {params:d}); var desc = await jc.post(this.editable.add_url, {params:d});
@ -385,7 +389,11 @@ bricks.Tree = class extends bricks.VScrollPanel {
async update_node_inputed(event){ async update_node_inputed(event){
var d = event.params; var d = event.params;
var node = this.selected_node; var node = this.selected_node;
if (d instanceof FormData){
d.append(this.idField, node.get_id());
} else {
d[this.idField] = node.get_id(); d[this.idField] = node.get_id();
}
if(this.editable.update_url){ if(this.editable.update_url){
var jc = new bricks.HttpJson() var jc = new bricks.HttpJson()
var desc = await jc.post(this.editable.update_url, {params:d}); var desc = await jc.post(this.editable.update_url, {params:d});