From 76c107199403770b2a7a69c94113a9213a1f6064 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Wed, 4 Sep 2024 13:04:32 +0100 Subject: [PATCH] templates: grants_table_scripts: Stop datatables from sending an alert This breaks tests and is not good for user experience. --- .../frontend/templates/components/grants_table_scripts.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grantnav/frontend/templates/components/grants_table_scripts.html b/grantnav/frontend/templates/components/grants_table_scripts.html index 98e4e69e..3e328923 100644 --- a/grantnav/frontend/templates/components/grants_table_scripts.html +++ b/grantnav/frontend/templates/components/grants_table_scripts.html @@ -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, @@ -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');