diff options
author | zsloan | 2020-09-10 14:33:52 -0500 |
---|---|---|
committer | zsloan | 2020-09-10 14:33:52 -0500 |
commit | 657ab53bef4fc767fdc549f004153a7910b45bd0 (patch) | |
tree | eff2092bcae5d6f84366cc6ce55653f70e20b3cf | |
parent | 0ba82e21e4ec8a0364ee22351e130106dd0b53ea (diff) | |
download | genenetwork2-657ab53bef4fc767fdc549f004153a7910b45bd0.tar.gz |
Fixed several sorting issues and moved orderDataType definitions into
search_results.js since all the tables that use them import that file
(that file's name needs to be changed, though)
* wqflask/wqflask/static/new/javascript/search_results.js - Added the
dom-checkbox and dom-inner-text order types into this file; they were
previously duplicated across several template files
* wqflask/wqflask/templates/gsearch_gene.html - Added dom-inner-text
order type to relevant columns with hyperlink contents and disabled
deferRender since it conflicted with use of both pagination and
orderDataType for sorting
* wqflask/wqflask/templates/gsearch_pheno.html - Same as above
* wqflask/wqflask/templates/mapping_results.html - Added dom-inner-text
for a few columns that have hyperlink values - still need to modify
natural-minus-na to also include other "N/A"-equivalent values like "--"
* wqflask/wqflask/templates/search_result_page.html Removed the
dom-checkbox and dom-inner-text order types from this file since they
were moved to search_results.js
-rw-r--r-- | wqflask/wqflask/static/new/javascript/search_results.js | 14 | ||||
-rw-r--r-- | wqflask/wqflask/templates/gsearch_gene.html | 16 | ||||
-rw-r--r-- | wqflask/wqflask/templates/gsearch_pheno.html | 17 | ||||
-rw-r--r-- | wqflask/wqflask/templates/mapping_results.html | 12 | ||||
-rw-r--r-- | wqflask/wqflask/templates/search_result_page.html | 15 |
5 files changed, 23 insertions, 51 deletions
diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js index 4e87d67a..b696dc4d 100644 --- a/wqflask/wqflask/static/new/javascript/search_results.js +++ b/wqflask/wqflask/static/new/javascript/search_results.js @@ -281,4 +281,18 @@ $(function() { } }); + $.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col ) + { + return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { + return $('input', td).prop('checked') ? '1' : '0'; + } ); + }; + + $.fn.dataTable.ext.order['dom-inner-text'] = function ( settings, col ) + { + return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { + return $(td).text(); + } ); + } + });
\ No newline at end of file diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index 478d6f5f..d2c78d65 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -59,20 +59,6 @@ </script> <script type="text/javascript" charset="utf-8"> - $.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col ) - { - return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { - return $('input', td).prop('checked') ? '1' : '0'; - } ); - }; - - $.fn.dataTable.ext.order['dom-inner-text'] = function ( settings, col ) - { - return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { - return $(td).text(); - } ); - } - $(document).ready( function () { $('#trait_table tr').click(function(event) { @@ -252,7 +238,7 @@ 'sDom': "pitirp", 'autoWidth': true, 'iDisplayLength': 500, - 'deferRender': true, + 'deferRender': false, 'paging': true, 'orderClasses': true, 'processing': true, diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index eb998d15..c44231f3 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -59,20 +59,6 @@ </script> <script type="text/javascript" charset="utf-8"> - $.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col ) - { - return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { - return $('input', td).prop('checked') ? '1' : '0'; - } ); - }; - - $.fn.dataTable.ext.order['dom-inner-text'] = function ( settings, col ) - { - return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { - return $(td).text(); - } ); - } - $(document).ready( function () { $('#trait_table tr').click(function(event) { @@ -172,6 +158,7 @@ 'title': "Record", 'type': "natural", 'data': null, + 'orderDataType': "dom-inner-text", 'render': function(data, type, row, meta) { return '<a target="_blank" href="/show_trait?trait_id=' + data.name + '&dataset=' + data.dataset + '">' + data.display_name + '</a>' } @@ -252,7 +239,7 @@ 'order': [[1, "asc" ]], 'sDom': "pitirp", 'autoWidth': false, - 'deferRender': true, + 'deferRender': false, 'iDisplayLength': 500, 'paging': true, 'orderClasses': true, diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html index 8edda548..9c170494 100644 --- a/wqflask/wqflask/templates/mapping_results.html +++ b/wqflask/wqflask/templates/mapping_results.html @@ -395,16 +395,16 @@ $('td', row).eq(9).attr("align", "right"); }, "columns": [ - { "bSortable": false}, - { "type": "natural" }, - { "type": "natural" }, - { "type": "natural" }, - { "type": "natural" }, - { "type": "natural" }, + { "orderDataType": "dom-checkbox" }, + { "type": "natural"}, + { "type": "natural" , "orderDataType": "dom-inner-text" }, + { "type": "natural" , "orderDataType": "dom-inner-text" }, + { "type": "natural" , "orderDataType": "dom-inner-text" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, + { "type": "natural" , "orderDataType": "dom-inner-text" }, { "type": "natural" } ], "columnDefs": [ { diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 53373b41..282e752d 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -174,21 +174,6 @@ </script> <script type="text/javascript" charset="utf-8"> - - $.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col ) - { - return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { - return $('input', td).prop('checked') ? '1' : '0'; - } ); - }; - - $.fn.dataTable.ext.order['dom-inner-text'] = function ( settings, col ) - { - return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { - return $(td).text(); - } ); - } - $(document).ready( function () { $('#trait_table tr').click(function(event) { |