diff options
-rw-r--r-- | wqflask/wqflask/templates/case_attributes.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/wqflask/wqflask/templates/case_attributes.html b/wqflask/wqflask/templates/case_attributes.html index d64efd0f..756c3a68 100644 --- a/wqflask/wqflask/templates/case_attributes.html +++ b/wqflask/wqflask/templates/case_attributes.html @@ -257,10 +257,27 @@ $(this).parents("tr").find(".add, .edit").toggle(); $(".add-new").attr("disabled", "disabled"); }); + // Delete row on delete button click $(document).on("click", ".delete", function(){ $(this).parents("tr").remove(); $(".add-new").removeAttr("disabled"); + let node = $(this).parents("tr") + + let diff = {}; + diff["Deletion"] = { + name: node.find(".name").data("original-value"), + description: node.find(".description").data("original-value"), + id: node.data("id")} + console.log(diff) + $.ajax({ + type: "POST", + data: {"data": JSON.stringify(diff)}, + url: '{{ url_for("metadata_edit.update_case_attributes") }}', + success: function(data, status, xhr) { + location.reload(); + } + }); }); }); </script> |