diff options
author | uditgulati | 2021-05-10 03:34:26 -0500 |
---|---|---|
committer | BonfaceKilz | 2021-05-10 12:23:57 +0300 |
commit | ff5ab1875025efdfa23209e58c651c7816c6b916 (patch) | |
tree | 875fcf4b58a0ac9285eb719d0ff96b3adaf81a95 /wqflask/wqflask/templates | |
parent | 8c8cec89a03b642b671f191ce8a6079883fe5500 (diff) | |
download | genenetwork2-ff5ab1875025efdfa23209e58c651c7816c6b916.tar.gz |
add ServerSideTable to gsearch geno and pheno tables
Diffstat (limited to 'wqflask/wqflask/templates')
-rw-r--r-- | wqflask/wqflask/templates/gsearch_gene.html | 15 | ||||
-rw-r--r-- | wqflask/wqflask/templates/gsearch_pheno.html | 15 |
2 files changed, 24 insertions, 6 deletions
diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index 6fd0abe8..48953d98 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -55,7 +55,15 @@ <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script type='text/javascript'> - var the_rows = {{ trait_list|safe }}; + var getParams = function(url) { + let parser = document.createElement('a'); + parser.href = url; + let params = parser.search.substring(1); + if(params.length > 0) { + return ('?'+params); + } + return params; + }; </script> <script type="text/javascript" charset="utf-8"> @@ -142,7 +150,6 @@ $('td', row).eq(12).attr('data-export', $('td', row).eq(12).text()); $('td', row).eq(13).attr('data-export', $('td', row).eq(13).text()); }, - 'data': the_rows, 'columns': [ { 'data': null, @@ -237,11 +244,13 @@ 'order': [[1, "asc" ]], 'sDom': "pitirp", 'autoWidth': true, - 'iDisplayLength': 500, 'deferRender': false, 'paging': true, 'orderClasses': true, 'processing': true, + 'iDisplayLength': 100, + 'bServerSide': true, + 'sAjaxSource': '/gsearch_table'+getParams(window.location.href), 'language': { 'loadingRecords': ' ', 'processing': 'Loading...' diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index 987b51a7..af9740ae 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -55,7 +55,15 @@ <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script type='text/javascript'> - var the_rows = {{ trait_list|safe }}; + var getParams = function(url) { + let parser = document.createElement('a'); + parser.href = url; + let params = parser.search.substring(1); + if(params.length > 0) { + return ('?'+params); + } + return params; + }; </script> <script type="text/javascript" charset="utf-8"> @@ -130,7 +138,6 @@ $('td', row).eq(9).attr('data-export', $('td', row).eq(9).text()); $('td', row).eq(10).attr('data-export', $('td', row).eq(10).text()); }, - 'data': the_rows, 'columns': [ { 'data': null, @@ -241,10 +248,12 @@ 'sDom': "pitirp", 'autoWidth': false, 'deferRender': false, - 'iDisplayLength': 500, 'paging': true, 'orderClasses': true, 'processing': true, + 'iDisplayLength': 100, + 'bServerSide': true, + 'sAjaxSource': '/gsearch_table'+getParams(window.location.href), 'language': { 'loadingRecords': ' ', 'processing': 'Loading...' |