diff options
author | zsloan | 2021-08-11 20:26:45 +0000 |
---|---|---|
committer | zsloan | 2021-08-11 20:26:45 +0000 |
commit | 9a1e7270bc9c2130a4cb9405f2de24053dea6582 (patch) | |
tree | cc6ee0f9bb0799c4bf5e6cf076b8741a3bc8a2af /wqflask | |
parent | 2dce5e20b5dcfa032a32a486bb4e4a4390c5f2b7 (diff) | |
download | genenetwork2-9a1e7270bc9c2130a4cb9405f2de24053dea6582.tar.gz |
Sort by attribute ID instead of name in initialize_show_trait_tables.js when defining attribute columns
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js | 4 |
1 files changed, 2 insertions, 2 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 6ca92fb6..49311f87 100644 --- a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js +++ b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js @@ -93,7 +93,7 @@ build_columns = function() { ); } - attr_keys = Object.keys(js_data.attributes).sort((a, b) => (js_data.attributes[a].name.toLowerCase() > js_data.attributes[b].name.toLowerCase()) ? 1 : -1) + attr_keys = Object.keys(js_data.attributes).sort((a, b) => (js_data.attributes[a].id > js_data.attributes[b].id) ? 1 : -1) for (i = 0; i < attr_keys.length; i++){ column_list.push( { @@ -101,7 +101,7 @@ build_columns = function() { 'type': "natural", 'data': null, 'render': function(data, type, row, meta) { - attr_name = Object.keys(data.extra_attributes).sort()[meta.col - data.first_attr_col] + attr_name = Object.keys(data.extra_attributes).sort((a, b) => (parseInt(a) > parseInt(b)) ? 1 : -1)[meta.col - data.first_attr_col] if (attr_name != null && attr_name != undefined){ if (Array.isArray(data.extra_attributes[attr_name])){ |