From 43706c381ed211ff92338be689a7d32c010dcf70 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 19 Jan 2022 21:01:54 +0000 Subject: Changed search result index column to be static (so it doesn't change when the user sorts) --- wqflask/wqflask/templates/search_result_page.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index fb335fd3..56ac6e82 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -195,6 +195,8 @@ 'title': "Index", 'type': "natural", 'width': "35px", + "searchable": false, + "orderable": false, 'targets': 1, 'data': "index" } @@ -491,6 +493,12 @@ } } + trait_table.on( 'order.dt search.dt', function () { + trait_table.column(1, {search:'applied', order:'applied'}).nodes().each( function (cell, i) { + cell.innerHTML = i+1; + } ); + } ).draw(); + window.addEventListener('resize', function(){ trait_table.columns.adjust(); }); -- cgit v1.2.3