about summary refs log tree commit diff
path: root/wqflask/wqflask/static/new/javascript
diff options
context:
space:
mode:
authorzsloan2016-10-21 19:53:36 +0000
committerzsloan2016-10-21 19:53:36 +0000
commit4feab4e85475834fafa930291934b441d1611e44 (patch)
tree8955c96527bccd4f017e8c33ed05c2dc4a9f006e /wqflask/wqflask/static/new/javascript
parent921726b7bf2ced0cbb348f366d8a2955400567c3 (diff)
downloadgenenetwork2-4feab4e85475834fafa930291934b441d1611e44.tar.gz
Added metadata to "Download Table"
Only checked traits are now downloaded and all traits are downloaded if nothing is checked
Diffstat (limited to 'wqflask/wqflask/static/new/javascript')
-rw-r--r--wqflask/wqflask/static/new/javascript/search_results.js25
1 files changed, 19 insertions, 6 deletions
diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js
index 54a61a45..5250523f 100644
--- a/wqflask/wqflask/static/new/javascript/search_results.js
+++ b/wqflask/wqflask/static/new/javascript/search_results.js
@@ -174,13 +174,26 @@ $(function() {
 
     rows = [];
     trait_table.find('tbody tr').each(function (i, tr) {
-      this_row = [];
-      $(tr).find('td').each(function(j, td){
-        if ($(td).data('export')){
-          this_row.push($(td).data('export'));
+      if (trait_table.find('input[name="searchResult"]:checked').length > 0) {
+        if ($(this).find('input[name="searchResult"]').is(':checked')){
+          this_row = [];
+          $(tr).find('td').each(function(j, td){
+            if ($(td).data('export')){
+              this_row.push($(td).data('export'));
+            }
+          });
+          rows.push(this_row);
         }
-      });
-      rows.push(this_row);
+      }
+      else {
+        this_row = [];
+        $(tr).find('td').each(function(j, td){
+          if ($(td).data('export')){
+            this_row.push($(td).data('export'));
+          }
+        });
+        rows.push(this_row);
+      }
     });
     table_dict['rows'] = rows;
     console.log("TABLEDICT:", table_dict);