From b0061cd6f580733b11be741ebc9baff945b9720a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 16 Jan 2025 23:02:15 +0800 Subject: [PATCH] bugfix --- bricks/tree.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bricks/tree.js b/bricks/tree.js index 77c3e81..38a414c 100644 --- a/bricks/tree.js +++ b/bricks/tree.js @@ -269,7 +269,11 @@ bricks.Tree = class extends bricks.VScrollPanel { var node = this; if (this.selected_node){ node = this.selected_node; - d[this.parentField] = node.get_id(); + if (d instanceof FormData){ + d.append(this.parentField, node.get_id()); + } else { + d[this.parentField] = node.get_id(); + } } if (this.editable.add_url){ var jc = new bricks.HttpJson() @@ -385,7 +389,11 @@ bricks.Tree = class extends bricks.VScrollPanel { async update_node_inputed(event){ var d = event.params; var node = this.selected_node; - d[this.idField] = node.get_id(); + if (d instanceof FormData){ + d.append(this.idField, node.get_id()); + } else { + d[this.idField] = node.get_id(); + } if(this.editable.update_url){ var jc = new bricks.HttpJson() var desc = await jc.post(this.editable.update_url, {params:d});