Skip to content

Commit

Permalink
templates: grants_table_scripts: Stop datatables from sending an alert
Browse files Browse the repository at this point in the history
This breaks tests and is not good for user experience.
  • Loading branch information
michaelwood committed Sep 4, 2024
1 parent 46f614f commit 76c1071
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@
}
}

/* override default which is to show an alert() dialog */
$.fn.dataTable.ext.errMode = 'throw';

jQuery(function ($) {
$('#search_grants_datatable').dataTable({
serverSide: true,
Expand All @@ -167,7 +170,6 @@
columns: getColumns()
});

const table = $('#search_grants_datatable').DataTable();
table.on('draw', function () {
if (document.getElementById('search_grants_datatable_paginate')) {
const previousButton = document.getElementById('search_grants_datatable_previous');
Expand Down

0 comments on commit 76c1071

Please sign in to comment.