From cdeddcea5eecbb4f20dd46ffc21af36090622802 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 28 Apr 2025 15:46:50 -0500 Subject: Search for radio was slow for some reason. --- uploader/templates/phenotypes/add-phenotypes-base.html | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'uploader') 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 @@
Publication Information + Select a publication for your data @@ -82,12 +83,7 @@ "#tbl-select-publication", [], [ - { - data: (pub) => { - return ``; - } - }, + {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); }); }); }); -- cgit v1.2.3