aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2021-08-12 23:28:49 +0000
committerzsloan2021-08-12 23:28:49 +0000
commit6acafff1b22089916b8323afb872e2ebed37943a (patch)
tree3bdd9a0c5dd505b5a29ce47bc10b138e855b5a08
parent9ae4c8d0370137c3a698d57566305d815929d4ce (diff)
downloadgenenetwork2-6acafff1b22089916b8323afb872e2ebed37943a.tar.gz
Account for user selecting one of the two sample groups if more than one exist
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 3957175b..845ed907 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -718,9 +718,19 @@ block_by_index = function() {
filter_by_study = function() {
let this_study = $('#filter_study').val();
- let block_group = $('#filter_study_group').val();
+
let study_sample_data = JSON.parse($('input[name=study_samplelists]').val())
let filter_samples = study_sample_data[parseInt(this_study)]['samples']
+
+ if ($('#filter_study_group').length){
+ let block_group = $('#filter_study_group').val();
+ if (block_group === "other") {
+ table_api = $('#samples_other').DataTable();
+ } else {
+ table_api = $('#samples_primary').DataTable();
+ }
+ }
+
let sample_nodes = table_api.column(2).nodes().to$();
let val_nodes = table_api.column(3).nodes().to$();
for (i = 0; i < sample_nodes.length; i++) {