Added no-sort options to tables

Added a no-sort class to column headers where sorting doesn’t make
sense.  Still have the attachments table in the templates page to do,
there was something strange happening.
pull/87/head
Justin Gray 2016-01-17 15:27:11 -06:00
parent 2ff2cbd1ca
commit b9fd654f8a
10 changed files with 39 additions and 14 deletions

View File

@ -95,7 +95,11 @@ $(document).ready(function(){
$("#loading").hide()
if (campaigns.length > 0){
$("#campaignTable").show()
campaignTable = $("#campaignTable").DataTable();
campaignTable = $("#campaignTable").DataTable({
columnDefs: [
{ orderable: false, targets: "no-sort" }
]
});
$.each(campaigns, function(i, campaign){
label = labels[campaign.status] || "label-default";
campaignTable.row.add([
@ -131,7 +135,11 @@ $(document).ready(function(){
return false;
})
// Create the group typeahead objects
groupTable = $("#groupTable").DataTable()
groupTable = $("#groupTable").DataTable({
columnDefs: [
{ orderable: false, targets: "no-sort" }
]
})
group_bh = new Bloodhound({
datumTokenizer: function(g) { return Bloodhound.tokenizers.whitespace(g.name) },
queryTokenizer: Bloodhound.tokenizers.whitespace,

View File

@ -33,7 +33,11 @@ $(document).ready(function(){
showLabel: false
}
var average = 0
campaignTable = $("#campaignTable").DataTable();
campaignTable = $("#campaignTable").DataTable({
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 label = labels[campaign.status] || "label-default";

View File

@ -92,7 +92,11 @@ function load(){
$("#loading").hide()
if (pages.length > 0){
$("#pagesTable").show()
pagesTable = $("#pagesTable").DataTable();
pagesTable = $("#pagesTable").DataTable({
columnDefs: [
{ orderable: false, targets: "no-sort" }
]
});
pagesTable.clear()
$.each(pages, function(i, page){
pagesTable.row.add([

View File

@ -178,7 +178,11 @@ function load(){
$("#loading").hide()
if (templates.length > 0){
$("#templateTable").show()
templateTable = $("#templateTable").DataTable();
templateTable = $("#templateTable").DataTable({
columnDefs: [
{ orderable: false, targets: "no-sort" }
]
});
templateTable.clear()
$.each(templates, function(i, template){
templateTable.row.add([

View File

@ -53,8 +53,9 @@ function dismiss(){
function edit(idx){
targets = $("#targetsTable").dataTable({
destroy: true,// Destroy any other instantiated table - http://datatables.net/manual/tech-notes/3#destroy
columnDefs: [
{ orderable: false, targets: -1 }
{ orderable: false, targets: "no-sort" }
]
})
$("#modalSubmit").unbind('click').click(function(){save(idx)})
@ -123,7 +124,11 @@ function load(){
groups = gs
$("#emptyMessage").hide()
$("#groupTable").show()
groupTable = $("#groupTable").DataTable();
groupTable = $("#groupTable").DataTable({
columnDefs: [
{ orderable: false, targets: "no-sort" }
]
});
groupTable.clear();
$.each(groups, function(i, group){
var targets = ""

View File

@ -47,7 +47,7 @@
<th>Name</th>
<th>Created Date</th>
<th>Status</th>
<th class="col-md-2"></th>
<th class="col-md-2 no-sort"></th>
</tr>
</thead>
<tbody>
@ -113,7 +113,7 @@
<table id="groupTable" class="table table-hover table-striped table-condensed">
<thead>
<th>Group Name</th>
<th></th>
<th class="no-sort"></th>
<tbody>
</tbody>
</table>

View File

@ -67,7 +67,7 @@
<th>Name</th>
<th>Created Date</th>
<th>Status</th>
<th class="col-md-2 col-sm-2"></th>
<th class="col-md-2 col-sm-2 no-sort"></th>
</tr>
</thead>
<tbody>

View File

@ -44,7 +44,7 @@
<tr>
<th>Name</th>
<th>Last Modified Date</th>
<th class="col-md-2"></th>
<th class="col-md-2 no-sort"></th>
</tr>
</thead>
<tbody>

View File

@ -46,7 +46,7 @@
<tr>
<th>Name</th>
<th>Modified Date</th>
<th class="col-md-2"></th>
<th class="col-md-2 no-sort"></th>
</tr>
</thead>
<tbody>

View File

@ -47,7 +47,7 @@
<th>Name</th>
<th>Members</th>
<th>Modified Date</th>
<th class="col-md-2"></th>
<th class="col-md-2 no-sort"></th>
</tr>
</thead>
<tbody>
@ -101,7 +101,7 @@
<th>Last Name</th>
<th>Email</th>
<th>Position</th>
<th></th>
<th class="no-sort"></th>
<tbody>
</tbody>
</table>