aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2022-07-27 21:48:30 +0000
committerzsloan2022-07-27 21:48:30 +0000
commit3d39fbe474312b2de75bb0fc9142ff210917b0c4 (patch)
treed43facd05ebf1724bddb4293b79c4d773de285f8
parent20089ec8d1820ebecc5bb9de3100d98990f1e1a4 (diff)
downloadgenenetwork2-3d39fbe474312b2de75bb0fc9142ff210917b0c4.tar.gz
Define drawCallback in trait page tableSettings, since this table shouldn't call change_buttons
-rw-r--r--wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js
index 868f3ada..748e4f28 100644
--- a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js
+++ b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js
@@ -176,6 +176,19 @@ for (var i = 0; i < tableIds.length; i++) {
}
tableSettings = {
+ "drawCallback": function( settings ) {
+ $('#' + tableId + ' tr').off().on("click", function(event) {
+ if (event.target.type !== 'checkbox' && event.target.tagName.toLowerCase() !== 'a') {
+ var obj =$(this).find('input');
+ obj.prop('checked', !obj.is(':checked'));
+ }
+ if ($(this).hasClass("selected") && event.target.tagName.toLowerCase() !== 'a'){
+ $(this).removeClass("selected")
+ } else if (event.target.tagName.toLowerCase() !== 'a') {
+ $(this).addClass("selected")
+ }
+ });
+ },
'createdRow': function ( row, data, index ) {
$(row).attr('id', tableType + "_" + data.this_id)
$(row).addClass("value_se");