From 8fc6383a0bc3c932361d7b1634859ebbbb7a7307 Mon Sep 17 00:00:00 2001 From: zsloan Date: Sat, 4 Apr 2020 13:44:46 -0500 Subject: Indices on the trait page sample table are now static, to allow for selecting ranges of indices after sorting a column --- wqflask/wqflask/static/new/javascript/show_trait.js | 5 +++-- wqflask/wqflask/templates/show_trait.html | 10 ++++++++-- wqflask/wqflask/templates/show_trait_edit_data.html | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index a2fa37e0..abdffe5f 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -610,9 +610,9 @@ block_by_index = function() { for (_k = 0, _len1 = index_list.length; _k < _len1; _k++) { index = index_list[_k]; if ($('#block_group').val() === "primary") { - _results.push($('#Primary_' + index.toString()).find('.trait_value_input').val("x")); + _results.push($('#samples_primary').find('td.column_name-Index').filter(function() { return $(this).text() == index.toString() }).closest('tr').find('.trait_value_input').val("x")); } else if ($('#block_group').val() === "other") { - _results.push($('#Other_' + index.toString()).find('.trait_value_input').val("x")); + _results.push($('#samples_other').find('td.column_name-Index').filter(function() { return $(this).text() == index.toString() }).closest('tr').find('.trait_value_input').val("x")); } else { _results.push(void 0); } @@ -620,6 +620,7 @@ block_by_index = function() { return _results; }; $('#block_by_index').click(block_by_index); + hide_no_value = function() { return $('.value_se').each((function(_this) { return function(_index, element) { diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index c4f25733..81661f86 100644 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -277,8 +277,8 @@ { 'title': "ID", 'type': "natural", - 'data': "this_id", - 'searchable' : false + 'searchable' : false, + 'data': "this_id" }, { 'title': "Sample", @@ -364,6 +364,12 @@ } } ); + primary_table.on( 'order.dt search.dt', function () { + primary_table.column(1, {search:'applied', order:'applied'}).nodes().each( function (cell, i) { + cell.innerHTML = i+1; + } ); + } ).draw(); + $('#primary_searchbox').on( 'keyup', function () { primary_table.search($(this).val()).draw(); } ); diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html index ddc58784..05a2be73 100644 --- a/wqflask/wqflask/templates/show_trait_edit_data.html +++ b/wqflask/wqflask/templates/show_trait_edit_data.html @@ -39,6 +39,6 @@ trait = pd.read_csv("{{ this_trait.display_name}}.csv", header = 0, comment = "#
- {% endfor %} + {% endfor %} -- cgit v1.2.3