From 3c0715dc52dc583d8a84907a9ba41a799ed3068a Mon Sep 17 00:00:00 2001
From: zsloan
Date: Tue, 12 Jan 2021 11:09:11 -0600
Subject: Added a line that redraws the DataTable, which fixes its initial
scroll height
---
wqflask/wqflask/templates/search_result_page.html | 37 ++++++-----------------
1 file changed, 9 insertions(+), 28 deletions(-)
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 411a6628..5fe65c00 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -146,6 +146,7 @@
+
@@ -383,36 +384,16 @@
}{% endif %}
],
"order": [[1, "asc" ]],
- {% if dataset.type != 'Geno' %}
- buttons: [
- {
- extend: 'columnsToggle',
- columns: function( idx, data, node ) {
- if (idx != 0) {
- return true;
- } else {
- return false;
- }
- },
- postfixButtons: [ 'colvisRestore' ]
- }
- ],
- 'sDom': "Bpitirp",
- {% else %}
- 'sDom': "pitirp",
- {% endif %}
- 'iDisplayLength': 500,
- 'deferRender': true,
- 'paging': true,
- 'orderClasses': true,
- 'processing': true,
- 'bServerSide': true,
- 'sAjaxSource': '/search_table'+getParams(window.location.href),
- 'infoCallback': function(settings, start, end, max, total, pre) {
- return "Showing " + start + " to " + (start + this.api().data().length - 1) + " of " + total + " entries";
- }
+ 'sDom': "itir",
+ "autoWidth": true,
+ "bSortClasses": false,
+ "scrollY": "100vh",
+ "scroller": true,
+ "scrollCollapse": true
} );
+ trait_table.draw(); //ZS: This makes the table adjust its height properly on initial load
+
$('.toggle-vis').on( 'click', function (e) {
e.preventDefault();
--
cgit v1.2.3