diff options
author | Frederick Muriuki Muriithi | 2025-04-28 15:46:50 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-04-28 15:46:50 -0500 |
commit | cdeddcea5eecbb4f20dd46ffc21af36090622802 (patch) | |
tree | 60083919a81fcc630f20b8a865cf41027a597c49 /uploader | |
parent | be1bd398f2277490c60a57dd054e1630aede1111 (diff) | |
download | gn-uploader-cdeddcea5eecbb4f20dd46ffc21af36090622802.tar.gz |
Search for radio was slow for some reason.
Diffstat (limited to 'uploader')
-rw-r--r-- | uploader/templates/phenotypes/add-phenotypes-base.html | 18 |
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); }); }); }); |