aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2020-04-04 13:44:46 -0500
committerzsloan2020-04-04 13:44:46 -0500
commit8fc6383a0bc3c932361d7b1634859ebbbb7a7307 (patch)
treebd4c2c9d509869b2d775aca4dbcc615309faa428
parent897f3291f9d943b4deaef7bc924197c268bc8b3f (diff)
downloadgenenetwork2-8fc6383a0bc3c932361d7b1634859ebbbb7a7307.tar.gz
Indices on the trait page sample table are now static, to allow for selecting ranges of indices after sorting a column
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js5
-rw-r--r--wqflask/wqflask/templates/show_trait.html10
-rw-r--r--wqflask/wqflask/templates/show_trait_edit_data.html2
3 files changed, 12 insertions, 5 deletions
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 = "#
</div>
</div>
<br>
- {% endfor %}
+ {% endfor %}
<input type="hidden" name="Default_Name">
</div>