From 29abefa0f5cf9bc8dc86d614bb86644aee4bf740 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 9 Jan 2023 20:57:30 +0000 Subject: Add back option to search on trait page table This was mistakenly removed when the table code was refactored a while back --- .../static/new/javascript/initialize_show_trait_tables.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js index cfc4f39e..9b9ed68b 100644 --- a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js +++ b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js @@ -223,3 +223,15 @@ for (var i = 0; i < tableIds.length; i++) { create_table(tableId, js_data['sample_lists'][i], columnDefs, tableSettings); } + +primary_table = $('#samples_primary').DataTable(); +$('#primary_searchbox').on( 'keyup', function () { + primary_table.search($(this).val()).draw(); +} ); + +if ($('#samples_other').length) { + other_table = $('#samples_other').DataTable(); + $('#other_searchbox').on( 'keyup', function () { + other_table.search($(this).val()).draw(); + } ); +} -- cgit v1.2.3