diff options
-rw-r--r-- | wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js | 124 |
1 files changed, 0 insertions, 124 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 748e4f28..2765a880 100644 --- a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js +++ b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js @@ -223,127 +223,3 @@ for (var i = 0; i < tableIds.length; i++) { create_table(tableId, js_data['sample_lists'][i], columnDefs, tableSettings); } - - -// loadDataTable(firstRun=true, tableId="samples_primary", tableData=js_data['sample_lists'][0]) -// if (js_data.sample_lists.length > 1){ -// loadDataTable(firstRun=true, tableId="samples_other", tableData=js_data['sample_lists'][1]) -// } - -// function loadDataTable(firstRun=false, tableId, tableData){ -// if (!firstRun){ -// setUserColumnsDefWidths(tableId); -// } - -// if (tableId == "samples_primary"){ -// tableType = "Primary" -// } else { -// tableType = "Other" -// } - -// tableSettings = { -// 'createdRow': function ( row, data, index ) { -// $(row).attr('id', tableType + "_" + data.this_id) -// $(row).addClass("value_se"); -// if (data.outlier) { -// $(row).addClass("outlier"); -// $(row).attr("style", "background-color: orange;"); -// } -// $('td', row).eq(1).addClass("column_name-Index") -// $('td', row).eq(2).addClass("column_name-Sample") -// $('td', row).eq(3).addClass("column_name-Value") -// if (js_data.se_exists) { -// $('td', row).eq(5).addClass("column_name-SE") -// if (js_data.has_num_cases === true) { -// $('td', row).eq(6).addClass("column_name-num_cases") -// } else { -// if (js_data.has_num_cases === true) { -// $('td', row).eq(4).addClass("column_name-num_cases") -// } -// } -// } else { -// if (js_data.has_num_cases === true) { -// $('td', row).eq(4).addClass("column_name-num_cases") -// } -// } - -// for (i=0; i < attrKeys.length; i++) { -// $('td', row).eq(attributeStartPos + i + 1).addClass("column_name-" + js_data.attributes[attrKeys[i]].name) -// $('td', row).eq(attributeStartPos + i + 1).attr("style", "text-align: " + js_data.attributes[attrKeys[i]].alignment + "; padding-top: 2px; padding-bottom: 0px;") -// } -// }, -// 'data': tableData, -// 'columns': columnDefs, -// "order": [[1, "asc" ]], -// "sDom": "iti", -// "destroy": true, -// "autoWidth": false, -// "bSortClasses": false, -// "scrollY": "100vh", -// "scrollCollapse": true, -// "scroller": true, -// "iDisplayLength": -1, -// "initComplete": function (settings) { -// //Add JQueryUI resizable functionality to each th in the ScrollHead table -// $('#' + tableId + '_wrapper .dataTables_scrollHead thead th').resizable({ -// handles: "e", -// alsoResize: '#' + tableId + '_wrapper .dataTables_scrollHead table', //Not essential but makes the resizing smoother -// resize: function( event, ui ) { -// width_change = ui.size.width - ui.originalSize.width; -// }, -// stop: function () { -// saveColumnSettings(tableId, theTable); -// loadDataTable(firstRun=false, tableId, tableData); -// } -// }); -// } -// } - -// if (!firstRun){ -// $('#' + tableType.toLowerCase() + '_container').css("width", String($('#' + tableId).width() + width_change + 17) + "px"); //ZS : Change the container width by the change in width of the adjusted column, so the overall table size adjusts properly - -// let checked_rows = get_checked_rows(tableId); -// theTable = $('#' + tableId).DataTable(tableSettings); -// if (checked_rows.length > 0){ -// recheck_rows(theTable, checked_rows); -// } -// } else { -// theTable = $('#' + tableId).DataTable(tableSettings); -// theTable.draw(); -// } - -// theTable.on( 'order.dt search.dt draw.dt', function () { -// theTable.column(1, {search:'applied', order:'applied'}).nodes().each( function (cell, i) { -// cell.innerHTML = i+1; -// } ); -// } ).draw(); - -// if (firstRun){ -// $('#' + tableType.toLowerCase() + '_container').css("width", String($('#' + tableId).width() + 17) + "px"); -// } - -// $('#' + tableType.toLowerCase() + '_searchbox').on( 'keyup', function () { -// theTable.search($(this).val()).draw(); -// } ); - -// $('.toggle-vis').on('click', function (e) { -// e.preventDefault(); - -// function toggle_column(column) { -// //ZS: Toggle column visibility -// column.visible( ! column.visible() ); -// if (column.visible()){ -// $(this).removeClass("active"); -// } else { -// $(this).addClass("active"); -// } -// } - -// // Get the column API object -// var target_cols = $(this).attr('data-column').split(",") -// for (let i = 0; i < target_cols.length; i++){ -// var column = theTable.column( target_cols[i] ); -// toggle_column(column); -// } -// } ); -// } |