Stop the Processing widget when server returns an error

This commit is contained in:
Mike Terzo
2017-07-05 11:46:53 -04:00
parent 9bd0784838
commit 126b53aada

View File

@@ -35,6 +35,7 @@
{% macro datatable_init(table_html_id, ajax_url, default_length, length_selector, extra_options=None) -%}
// Init datatable
$.fn.dataTable.ext.errMode = 'throw';
var table = $('#{{ table_html_id }}').DataTable({
// Permit flow auto-readjust (responsive)
"autoWidth": false,
@@ -59,6 +60,11 @@
{% if extra_options %}{% call extra_options() %}Callback to parent defined options{% endcall %}{% endif %}
});
table.on('error', function ( e, settings, json ) {
table.clear().draw();
$('#facts_table_processing').hide(); })
table.on('draw.dt', function(){
$('#{{ table_html_id }} [rel=utctimestamp]').each(
function(index, timestamp){