Browse Source

Added datatables sorting for dashboard campaigns. Fixes #166. Also formatting fixes.

pull/186/head
Jordan Wright 5 years ago
parent
commit
77e38b6c72
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      static/js/app/dashboard.js

+ 7
- 6
static/js/app/dashboard.js View File

@ -14,7 +14,7 @@ function deleteCampaign(idx) {
api.campaignId.delete(campaigns[idx].id)
.success(function(data) {
successFlash(data.message)
location.reload()
location.reload()
})
}
}
@ -51,12 +51,13 @@ $(document).ready(function() {
}
var average = 0
campaignTable = $("#campaignTable").DataTable({
columnDefs: [
{ orderable: false, targets: "no-sort" }
]
});
columnDefs: [{
orderable: false,
targets: "no-sort"
}]
});
$.each(campaigns, function(i, campaign) {
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY h:mm:ss a')
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY, h:mm:ss a')
var label = labels[campaign.status] || "label-default";
// Add it to the table
campaignTable.row.add([

Loading…
Cancel
Save