From 964ce6f1525aa486dde613403ad8c2780a53bd95 Mon Sep 17 00:00:00 2001 From: Justin Gray Date: Wed, 20 Jan 2016 20:35:51 -0600 Subject: [PATCH] Fixed Double Instantiation When a modal was closed and the data was loaded again it tried to instantiate the table again, so always destroy the table on load. --- static/js/app/landing_pages.js | 1 + static/js/app/templates.js | 1 + static/js/app/users.js | 1 + 3 files changed, 3 insertions(+) diff --git a/static/js/app/landing_pages.js b/static/js/app/landing_pages.js index edbead61..c1f809f0 100644 --- a/static/js/app/landing_pages.js +++ b/static/js/app/landing_pages.js @@ -93,6 +93,7 @@ function load(){ if (pages.length > 0){ $("#pagesTable").show() pagesTable = $("#pagesTable").DataTable({ + destroy: true, columnDefs: [ { orderable: false, targets: "no-sort" } ] diff --git a/static/js/app/templates.js b/static/js/app/templates.js index fb04e267..fde003fe 100644 --- a/static/js/app/templates.js +++ b/static/js/app/templates.js @@ -182,6 +182,7 @@ function load(){ if (templates.length > 0){ $("#templateTable").show() templateTable = $("#templateTable").DataTable({ + destroy: true, columnDefs: [ { orderable: false, targets: "no-sort" } ] diff --git a/static/js/app/users.js b/static/js/app/users.js index 5a9a7d37..b8f116cf 100644 --- a/static/js/app/users.js +++ b/static/js/app/users.js @@ -125,6 +125,7 @@ function load(){ $("#emptyMessage").hide() $("#groupTable").show() groupTable = $("#groupTable").DataTable({ + destroy: true, columnDefs: [ { orderable: false, targets: "no-sort" } ]