about summary refs log tree commit diff
path: root/uploader/templates
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates')
-rw-r--r--uploader/templates/phenotypes/add-phenotypes-base.html18
1 files changed, 8 insertions, 10 deletions
diff --git a/uploader/templates/phenotypes/add-phenotypes-base.html b/uploader/templates/phenotypes/add-phenotypes-base.html
index 1463faa..b05a194 100644
--- a/uploader/templates/phenotypes/add-phenotypes-base.html
+++ b/uploader/templates/phenotypes/add-phenotypes-base.html
@@ -44,6 +44,7 @@
 
     <fieldset id="fldset-publication-info">
       <legend>Publication Information</legend>
+      <input type="hidden" name="publication-id" id="txt-publication-id" />
       <span class="form-text text-muted">
         Select a publication for your data</span>
       <table id="tbl-select-publication" class="table compact stripe">
@@ -82,12 +83,7 @@
           "#tbl-select-publication",
           [],
           [
-              {
-                  data: (pub) => {
-                      return `<input type="radio" name="publication-id" ` +
-                          `id="rdo-publication-id-${pub.Id}" value="${pub.Id}" />`;
-                  }
-              },
+              {data: "index"},
               {
                   data: (pub) => {
                   if(pub.PubMed_ID) {
@@ -137,15 +133,17 @@
               }
           });
       publicationsDataTable.on("select", (event, datatable, type, indexes) => {
-          rows = $("#tbl-select-publication tbody tr");// Really slow — troubleshoot
           indexes.forEach((element, index, thearray) => {
-              $(rows[element]).find('input[type="radio"]').attr("checked", true);
+              let row = datatable.row(element).node();
+              console.debug(datatable.row(element).data());
+              $("#frm-add-phenotypes #txt-publication-id").val(
+                  datatable.row(element).data().Id);
           });
       });
       publicationsDataTable.on("deselect", (event, datatable, type, indexes) => {
-          rows = $("#tbl-select-publication tbody tr");// Really slow — troubleshoot
           indexes.forEach((element, index, thearray) => {
-              $(rows[element]).find('input[type="radio"]').attr("checked", false);
+              let row = datatable.row(element).node();
+              $("#frm-add-phenotypes #txt-publication-id").val(null);
           });
       });
   });