aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2022-07-27 18:30:16 +0000
committerzsloan2022-07-27 18:30:16 +0000
commitfe25fee2b74be85e094a3c5a430114a7f02e578d (patch)
treef8270f0221d8d478a2aae4d4c81eed5320c3a6de
parentd1616a5e0e225dbedddf423ac3ec74a99a66d5cc (diff)
downloadgenenetwork2-fe25fee2b74be85e094a3c5a430114a7f02e578d.tar.gz
Use create_datatable.js for the Collection List table
-rw-r--r--wqflask/wqflask/templates/collections/list.html53
1 files changed, 16 insertions, 37 deletions
diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html
index 6e1261d7..1a125dbb 100644
--- a/wqflask/wqflask/templates/collections/list.html
+++ b/wqflask/wqflask/templates/collections/list.html
@@ -75,44 +75,22 @@
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/plugins/sorting/natural.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/buttons/js/dataTables.buttons.min.js') }}"></script>
<script type="text/javascript" src="/static/new/javascript/search_results.js"></script>
+ <script type="text/javascript" src="/static/new/javascript/table_functions.js"></script>
+ <script type="text/javascript" src="/static/new/javascript/create_datatable.js"></script>
<script>
- $('#trait_table').dataTable( {
- "drawCallback": function( settings ) {
- $('#trait_table tr').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")
- }
- });
- },
- "buttons": [ 'copy', 'csv', 'excel' ],
- "columns": [
- { "type": "natural", "width": "3%" },
- { "type": "natural", "width": "8%" },
- { "type": "natural", "width": "20%" },
- { "type": "natural", "width": "25%" },
- { "type": "natural", "width": "25%" },
- { "type": "natural", "width": "15%" }
- ],
- "columnDefs": [ {
- "targets": 0,
- "orderable": false
- } ],
- "order": [[1, "asc" ]],
- "sDom": "BZtr",
- "iDisplayLength": -1,
- "autoWidth": false,
- "bDeferRender": true,
- "bSortClasses": false,
- "scrollCollapse": true,
- "paging": false,
- "orderClasses": true
- } );
+ $(document).ready( function () {
+ tableId = "trait_table";
+
+ columnDefs = [
+ { "type": "natural", "width": "3%", "targets": 0, "orderable": false},
+ { "type": "natural", "width": "8%", "targets": 1},
+ { "type": "natural", "width": "20%", "targets": 2},
+ { "type": "natural", "width": "25%", "targets": 3},
+ { "type": "natural", "width": "25%", "targets": 4},
+ { "type": "natural", "width": "15%", "targets": 5}
+ ];
+
+ create_table(tableId, [], columnDefs)
submit_special = function(url) {
$("#collections_form").attr("action", url);
@@ -167,6 +145,7 @@
return submit_special(url)
});
+ });
</script>
{% endblock %}