From a1161401287bf676c212bc17854fe05572d87491 Mon Sep 17 00:00:00 2001 From: Zhou Ji Date: Mon, 17 May 2021 20:56:48 -0400 Subject: [PATCH] rebuild dataTable after ontoloy search. issue #487 --- web/src/main/webapp/js/ctd2.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/web/src/main/webapp/js/ctd2.js b/web/src/main/webapp/js/ctd2.js index d4e63837..3bf06c72 100644 --- a/web/src/main/webapp/js/ctd2.js +++ b/web/src/main/webapp/js/ctd2.js @@ -3054,6 +3054,7 @@ let submission_count = 0; let center_count = 0; const subject_result = ontology_search_results.subject_result; + $("#search-results-grid").DataTable().destroy(); _.each(subject_result, function (one_result) { if (subject_names.includes(one_result.dashboardEntity.displayName)) return; if (one_result.dashboardEntity.organism == undefined) { @@ -3099,6 +3100,23 @@ }); }); }); + $("#search-results-grid").dataTable({ + "columns": [ + null, + null, + null, + null, + null, + { + "orderDataType": "dashboard-rank", + "type": 'num', + }, + ] + }).fnSort([ + [5, 'desc'], + [1, 'asc'] + ]); + $("#search-results-grid").parent().find('input[type=search]').popover(table_filter_popover); $("#ontology-search").prop('disabled', true); //redo observations