Skip to content
Snippets Groups Projects
Commit e3951507 authored by Jakub Maloštík's avatar Jakub Maloštík
Browse files

Fix: remove duplicities when rerendering charts

parent 40cba694
No related branches found
No related tags found
No related merge requests found
...@@ -439,6 +439,8 @@ ...@@ -439,6 +439,8 @@
{%- macro _snippet_ecbks_timeline(chart_id, cfg_params, with_full = False) %} {%- macro _snippet_ecbks_timeline(chart_id, cfg_params, with_full = False) %}
// Enable necessary event callbacks to appropriate DOM elements. // Enable necessary event callbacks to appropriate DOM elements.
$(document).ready(function () { $(document).ready(function () {
// unbind click event listener
$("#{{ chart_id }}_toggle").off('click');
// Event handler for toggling dataset table. // Event handler for toggling dataset table.
$("#{{ chart_id }}_toggle").click(function () { $("#{{ chart_id }}_toggle").click(function () {
$("#{{ chart_id }}_content").toggleClass("col-md-12 col-md-6"); $("#{{ chart_id }}_content").toggleClass("col-md-12 col-md-6");
......
...@@ -562,6 +562,9 @@ function render_table_timeline_multi(tid, table_columns, table_data, data_stats) ...@@ -562,6 +562,9 @@ function render_table_timeline_multi(tid, table_columns, table_data, data_stats)
var value_formatter = table_value_formatter(GLOBALIZER.numberFormatter()); var value_formatter = table_value_formatter(GLOBALIZER.numberFormatter());
var date_formatter = table_value_formatter(GLOBALIZER.dateFormatter()); var date_formatter = table_value_formatter(GLOBALIZER.dateFormatter());
// remove the existing table
d3.select(`#${tid} > table`).remove();
var table = d3.select('#' + tid).append('table') var table = d3.select('#' + tid).append('table')
var thead = table.append('thead') var thead = table.append('thead')
var tbody = table.append('tbody'); var tbody = table.append('tbody');
...@@ -722,6 +725,9 @@ function render_table_dict(tid, table_columns, table_data, data_stats, action_li ...@@ -722,6 +725,9 @@ function render_table_dict(tid, table_columns, table_data, data_stats, action_li
}) })
); );
// remove the existing table
d3.select(`#${tid} > table`).remove();
var table = d3.select('#' + tid).append('table') var table = d3.select('#' + tid).append('table')
var thead = table.append('thead') var thead = table.append('thead')
var tbody = table.append('tbody'); var tbody = table.append('tbody');
...@@ -899,6 +905,9 @@ function render_table_mdict(tid, table_columns, table_data, data_stats, total = ...@@ -899,6 +905,9 @@ function render_table_mdict(tid, table_columns, table_data, data_stats, total =
}) })
); );
// remove the existing table
d3.select(`#${tid} > table`).remove();
var table = d3.select('#' + tid).append('table') var table = d3.select('#' + tid).append('table')
var thead = table.append('thead') var thead = table.append('thead')
var tbody = table.append('tbody'); var tbody = table.append('tbody');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment