Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82115

Sort one column using another as a tie-breaker

$
0
0
I've gone through the examples, but I can't seem to find anything specific to my needs.

I have a table that I would like to be able to sort on columns 1 or 2 (no problems doing that), but when sorting on column 2, I'd like to use column 1 as a tie-breaker (where I get stumped) but only when sorting on column 2. I still need Column 1 sortable on its own though.

HTML:
<table class="sortabletable">
<thead>
<tr><th>ID#</th><th>Event Time</th><th>Event Information</th></tr>
</thead>
<tbody>
<tr><td>AX1002</td><td>2012-12-12 11:45</td><td>Event Location: 123 Fake St.</td></tr>
<tr><td>AX1001</td><td>2012-12-12 11:45</td><td>Event Location: 818 Springfield Ave.</td></tr>
<tr><td>AX1003</td><td>2012-12-12 11:45</td><td>Event Location: 9296 Main St.</td></tr>
<tr><td>AX1004</td><td>2012-12-18 14:30</td><td>Event Location: 123 Fake St.</td></tr>
<tr><td>AX1005</td><td>2012-12-12 11:00</td><td>Event Location: 1600 Pennsylvania Ave.</td></tr>
<tr><td>AX1006</td><td>2012-12-24 09:15</td><td>Event Location: 9296 Main St.</td></tr>
</tbody>
</table>

I know that you can do a mult-column sort but that requires a shift-click which my users will tend not to do so a single-click solution would be ideal.

Viewing all articles
Browse latest Browse all 82115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>