diff options
author | zsloan | 2019-11-11 14:22:28 -0600 |
---|---|---|
committer | zsloan | 2019-11-11 14:22:28 -0600 |
commit | 62424a50ab0887e295542b8b4982faf1d445198a (patch) | |
tree | 43da40bad9b2a16891774536e6c4ae24b3da2680 | |
parent | c95e8c512db6eec9381cbc51074be2986d9e8659 (diff) | |
download | genenetwork2-62424a50ab0887e295542b8b4982faf1d445198a.tar.gz |
Fixed issue that caused datatables error when case attributes missing
-rw-r--r-- | wqflask/wqflask/templates/show_trait.html | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index f6121d7b..0f49b092 100644 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -328,7 +328,7 @@ 'type': "cust-txt", 'data': null, 'render': function(data, type, row, meta) { - if (data.num_cases == null) { + if (data.num_cases == null || data.num_cases == undefined) { return '<input type="text" data-value="x" data-qnorm="x" data-zscore="x" name="value:' + data.name + '" style="text-align: right;" class="trait_value_input edit_sample_num_cases" value="x" size=4 maxlength=4>' } else { return '<input type="text" data-value="' + data.num_cases + '" data-qnorm="x" data-zscore="x" name="value:' + data.name + '" style="text-align: right;" class="trait_value_input edit_sample_num_cases" value="' + data.num_cases + '" size=4 maxlength=4>' @@ -340,7 +340,11 @@ 'type': "natural", 'data': null, 'render': function(data, type, row, meta) { - return data.extra_attributes['{{ sample_groups[0].attributes[attribute].name }}'] + if (data.extra_attributes['{{ sample_groups[0].attributes[attribute].name }}'] != null && data.extra_attributes['{{ sample_groups[0].attributes[attribute].name }}'] != undefined){ + return data.extra_attributes['{{ sample_groups[0].attributes[attribute].name }}'] + } else { + return "" + } } }{% endfor %}{% endif %} ], @@ -479,7 +483,11 @@ 'type': "natural", 'data': null, 'render': function(data, type, row, meta) { - return data.extra_attributes['{{ sample_groups[1].attributes[attribute].name }}'] + if (data.extra_attributes['{{ sample_groups[1].attributes[attribute].name }}'] != null && data.extra_attributes['{{ sample_groups[1].attributes[attribute].name }}'] != undefined){ + return data.extra_attributes['{{ sample_groups[1].attributes[attribute].name }}'] + } else { + return "" + } } }{% endfor %}{% endif %} ], |