Commit f0548e2e authored by Daniel W Bond's avatar Daniel W Bond
Browse files

changed sorting by last name, rather than first name @zmknox

parent 3f74a184
Pipeline #2285 passed with stages
in 1 minute and 14 seconds
...@@ -43,7 +43,7 @@ tablesorter_css: true ...@@ -43,7 +43,7 @@ tablesorter_css: true
<thead> <thead>
<tr> <tr>
<th data-sorter="false"></th> <th data-sorter="false"></th>
<th><h4>Name</h4></th> <th class="sorter-last-name"><h4>Name</h4></th>
<th data-sorter="false"><h4>Email</h4></th> <th data-sorter="false"><h4>Email</h4></th>
</tr> </tr>
</thead> </thead>
...@@ -70,7 +70,7 @@ tablesorter_css: true ...@@ -70,7 +70,7 @@ tablesorter_css: true
<thead> <thead>
<tr> <tr>
<th data-sorter="false"></th> <th data-sorter="false"></th>
<th><h4>Name</h4></th> <th class="sorter-last-name"><h4>Name</h4></th>
<th data-sorter="false"><h4>Email</h4></th> <th data-sorter="false"><h4>Email</h4></th>
</tr> </tr>
</thead> </thead>
...@@ -92,6 +92,23 @@ tablesorter_css: true ...@@ -92,6 +92,23 @@ tablesorter_css: true
<script src="/assets/js/jquery.tablesorter.min.js" type="text/javascript"></script> <script src="/assets/js/jquery.tablesorter.min.js" type="text/javascript"></script>
<script> <script>
$(function() { $(function() {
// from https://stackoverflow.com/questions/38209618/
// response there by the person who maintains the project
$.tablesorter.addParser({
id: 'last-name',
is: function() {
return false;
},
format: function(str) {
var parts = (str || '').split(/\s+/),
last = parts.pop();
parts.unshift(last);
return parts.join(' ');
},
// set type, either numeric or text
type: 'text'
});
$("#devs-table").tablesorter({ $("#devs-table").tablesorter({
theme: "bootstrap", theme: "bootstrap",
sortList: [[1,0]] sortList: [[1,0]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment