diff --git a/static/js/src/app/campaigns.js b/static/js/src/app/campaigns.js
index 8eb84117..17f35733 100644
--- a/static/js/src/app/campaigns.js
+++ b/static/js/src/app/campaigns.js
@@ -360,6 +360,7 @@ $(document).ready(function () {
[1, "desc"]
]
});
+ campaignRows = []
$.each(campaigns, function (i, campaign) {
campaignTable = campaignTableOriginal
if (campaign.status === "Completed") {
@@ -378,7 +379,7 @@ $(document).ready(function () {
var quickStats = launchDate + "
" + "Number of recipients: " + campaign.stats.total + "
" + "Emails opened: " + campaign.stats.opened + "
" + "Emails clicked: " + campaign.stats.clicked + "
" + "Submitted Credentials: " + campaign.stats.submitted_data + "
" + "Errors : " + campaign.stats.error + "Reported : " + campaign.stats.reported
}
- campaignTable.row.add([
+ campaignRows.push([
escapeHtml(campaign.name),
moment(campaign.created_date).format('MMMM Do YYYY, h:mm:ss a'),
"" + campaign.status + "",
@@ -391,9 +392,10 @@ $(document).ready(function () {
"
- ]).draw()
+ ])
$('[data-toggle="tooltip"]').tooltip()
})
+ campaignTable.rows.add(campaignRows).draw()
} else {
$("#emptyMessage").show()
}
@@ -417,4 +419,4 @@ $(document).ready(function () {
return 0;
});
})
-})
\ No newline at end of file
+})
diff --git a/static/js/src/app/dashboard.js b/static/js/src/app/dashboard.js
index 7c5bebaa..66f705a1 100644
--- a/static/js/src/app/dashboard.js
+++ b/static/js/src/app/dashboard.js
@@ -326,6 +326,7 @@ $(document).ready(function () {
[1, "desc"]
]
});
+ campaignRows = []
$.each(campaigns, function (i, campaign) {
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY, h:mm:ss a')
var label = statuses[campaign.status].label || "label-default";
@@ -338,8 +339,8 @@ $(document).ready(function () {
launchDate = "Launch Date: " + moment(campaign.launch_date).format('MMMM Do YYYY, h:mm:ss a')
var quickStats = launchDate + "
" + "Number of recipients: " + campaign.stats.total + "
" + "Emails opened: " + campaign.stats.opened + "
" + "Emails clicked: " + campaign.stats.clicked + "
" + "Submitted Credentials: " + campaign.stats.submitted_data + "
" + "Errors : " + campaign.stats.error + "
" + "Reported : " + campaign.stats.email_reported
}
- // Add it to the table
- campaignTable.row.add([
+ // Add it to the list
+ campaignRows.push([
escapeHtml(campaign.name),
campaign_date,
campaign.stats.sent,
@@ -354,9 +355,10 @@ $(document).ready(function () {
"
- ]).draw()
+ ])
$('[data-toggle="tooltip"]').tooltip()
})
+ campaignTable.rows.add(campaignRows).draw()
// Build the charts
generateStatsPieCharts(campaigns)
generateTimelineChart(campaigns)
@@ -367,4 +369,4 @@ $(document).ready(function () {
.error(function () {
errorFlash("Error fetching campaigns")
})
-})
\ No newline at end of file
+})
diff --git a/static/js/src/app/groups.js b/static/js/src/app/groups.js
index 6f4ab972..1bf701d8 100644
--- a/static/js/src/app/groups.js
+++ b/static/js/src/app/groups.js
@@ -69,17 +69,17 @@ function edit(id) {
api.groupId.get(id)
.success(function (group) {
$("#name").val(group.name)
+ targetRows = []
$.each(group.targets, function (i, record) {
- targets.DataTable()
- .row.add([
- escapeHtml(record.first_name),
- escapeHtml(record.last_name),
- escapeHtml(record.email),
- escapeHtml(record.position),
- ''
- ]).draw()
+ targetRows.push([
+ escapeHtml(record.first_name),
+ escapeHtml(record.last_name),
+ escapeHtml(record.email),
+ escapeHtml(record.position),
+ ''
+ ])
});
-
+ targets.DataTable().rows.add(targetRows).draw()
})
.error(function () {
errorFlash("Error fetching group")
@@ -233,8 +233,9 @@ function load() {
}]
});
groupTable.clear();
+ groupRows = []
$.each(groups, function (i, group) {
- groupTable.row.add([
+ groupRows.push([
escapeHtml(group.name),
escapeHtml(group.num_targets),
moment(group.modified_date).format('MMMM Do YYYY, h:mm:ss a'),
@@ -244,8 +245,9 @@ function load() {
"
- ]).draw()
+ ])
})
+ groupTable.rows.add(groupRows).draw()
} else {
$("#emptyMessage").show()
}
@@ -289,4 +291,4 @@ $(document).ready(function () {
dismiss();
});
$("#csv-template").click(downloadCSVTemplate)
-});
\ No newline at end of file
+});
diff --git a/static/js/src/app/landing_pages.js b/static/js/src/app/landing_pages.js
index 52192b98..29152746 100644
--- a/static/js/src/app/landing_pages.js
+++ b/static/js/src/app/landing_pages.js
@@ -157,8 +157,9 @@ function load() {
}]
});
pagesTable.clear()
+ pageRows = []
$.each(pages, function (i, page) {
- pagesTable.row.add([
+ pageRows.push([
escapeHtml(page.name),
moment(page.modified_date).format('MMMM Do YYYY, h:mm:ss a'),
"