From 8ef4528ba0f7b80e64cb5b867b05a5cf2f72a7fe Mon Sep 17 00:00:00 2001 From: Mike Kanning Date: Wed, 28 Apr 2021 15:34:21 -0400 Subject: [PATCH] disable autoWidth setting for DataTable. instead, adjust widths in the drawCallback so any changes to the DataTable contents trigger column width adjustment. --- app/assets/javascripts/availability.js.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/availability.js.erb b/app/assets/javascripts/availability.js.erb index ed6d46f8..3b27905e 100644 --- a/app/assets/javascripts/availability.js.erb +++ b/app/assets/javascripts/availability.js.erb @@ -116,6 +116,7 @@ $(document).ready(function() { { "visible": false, "targets": [0,6,7] }, { "orderable": false, "targets": 5 } ], + "autoWidth": false, "order": [], "language": { "search": "Filter records:", @@ -156,6 +157,9 @@ $(document).ready(function() { else { $('#requestOptions-' + mmsid + '_paginate').hide(); } + + // resize table columns + table.columns.adjust(); }, "initComplete": function(settings, json) { var table = $('#requestOptions-' + mmsid).DataTable();