From c2dbde48d1ebd830c674a8211f6db8a0ec739190 Mon Sep 17 00:00:00 2001 From: hollywoof Date: Fri, 5 Jun 2020 14:45:06 +0100 Subject: [PATCH 1/2] Clear previous RagGrid renders See #65 --- javascript/RagGrid.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/javascript/RagGrid.js b/javascript/RagGrid.js index 4f8eb4e..2d59b2a 100644 --- a/javascript/RagGrid.js +++ b/javascript/RagGrid.js @@ -71,6 +71,9 @@ HTMLWidgets.widget({ } }; + // clear any previous renders + document.getElementById(el.id).innerHTML = ''; + el.setAttribute("class", x.theme || "ag-theme-balham"); new agGrid.Grid(el, gridOptions); }, From cbff353fed81b3d410be1ea355e7ea94f4caf3de Mon Sep 17 00:00:00 2001 From: hollywoof Date: Fri, 5 Jun 2020 14:52:49 +0100 Subject: [PATCH 2/2] Cleaner implementation --- javascript/RagGrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/RagGrid.js b/javascript/RagGrid.js index 2d59b2a..0f87ea0 100644 --- a/javascript/RagGrid.js +++ b/javascript/RagGrid.js @@ -72,7 +72,7 @@ HTMLWidgets.widget({ }; // clear any previous renders - document.getElementById(el.id).innerHTML = ''; + el.innerHTML = ''; el.setAttribute("class", x.theme || "ag-theme-balham"); new agGrid.Grid(el, gridOptions);