about summary refs log tree commit diff
path: root/uploader
diff options
context:
space:
mode:
Diffstat (limited to 'uploader')
-rw-r--r--uploader/templates/phenotypes/view-dataset.html28
1 files changed, 28 insertions, 0 deletions
diff --git a/uploader/templates/phenotypes/view-dataset.html b/uploader/templates/phenotypes/view-dataset.html
index 293e524..f11377a 100644
--- a/uploader/templates/phenotypes/view-dataset.html
+++ b/uploader/templates/phenotypes/view-dataset.html
@@ -196,6 +196,34 @@
               });
               form.submit();
           });
+
+      $("#btn-delete-phenotypes").on(
+          "click",
+          function(event) {
+              // Collect selected phenotypes for deletion, if any.
+              event.preventDefault();
+              form = $("#frm-delete-phenotypes");
+              form.find(".dynamically-added-element").remove();
+              $("#tbl-phenotypes-list")
+                  .DataTable()
+                  .rows({selected: true}).
+                  nodes().each(function(node, index) {
+                      var parts = $(node)
+                          .find(".chk-row-select")
+                          .val()
+                          .split("_");
+                      var xref_id = parts[parts.length - 1].trim();
+                      var chk = $('<input type="checkbox">');
+                      chk.attr("class", "dynamically-added-element");
+                      chk.attr("value", xref_id);
+                      chk.attr("name", "xref_ids");
+                      chk.attr("style", "display: none");
+                      chk.prop("checked", true);
+                      console.debug(chk);
+                      form.append(chk);
+                  });
+              form.submit();
+          });
   });
 </script>
 {%endblock%}