Skip to content

Commit

Permalink
disable autoWidth setting for DataTable. instead, adjust widths in th…
Browse files Browse the repository at this point in the history
…e drawCallback so any changes to the DataTable contents trigger column width adjustment.
  • Loading branch information
mksndz committed Apr 28, 2021
1 parent dbe76f6 commit 8ef4528
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/availability.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ $(document).ready(function() {
{ "visible": false, "targets": [0,6,7] },
{ "orderable": false, "targets": 5 }
],
"autoWidth": false,
"order": [],
"language": {
"search": "Filter records:",
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 8ef4528

Please sign in to comment.