Stop the Processing widget when server returns an error
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user