From 978da92d6fdf6c1f3f9f4c56b963339725921248 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 18 Jan 2022 20:42:44 +0000 Subject: This fixes an issue where you couldn't select more than 150-200 rows when submitting search result traits to a collection; it previously just used JQuery and needed to be changed to use DataTables API to select from rows --- wqflask/wqflask/static/new/javascript/search_results.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js index 48b9b7be..9e507123 100644 --- a/wqflask/wqflask/static/new/javascript/search_results.js +++ b/wqflask/wqflask/static/new/javascript/search_results.js @@ -132,9 +132,13 @@ $(function() { add_to_collection = function() { var traits; - traits = $("#trait_table input:checked").map(function() { - return $(this).val(); - }).get(); + table_api = $('#trait_table').DataTable(); + check_nodes = table_api.column(0).nodes().to$(); + traits = Array.from(check_nodes.map(function() { + if ($(this)[0].childNodes[0].checked){ + return $(this)[0].childNodes[0].value + } + })) var traits_hash = md5(traits.toString()); @@ -337,4 +341,4 @@ $(function() { } apply_default(); -}); \ No newline at end of file +}); -- cgit v1.2.3