Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
j_tablesort template which includes the default sort option provided by Contao
// Add the tablesorter style sheet
$GLOBALS['TL_CSS'][] = 'assets/jquery/tablesorter/' . $GLOBALS['TL_ASSETS']['TABLESORTER'] . '/css/tablesorter.css|static';
<script src="<?= TL_ASSETS_URL ?>assets/jquery/tablesorter/<?= $GLOBALS['TL_ASSETS']['TABLESORTER'] ?>/js/tablesorter.js"></script>
<script src=""></script>
(function($) {
$(document).ready(function() {
$('.ce_table .sortable').each(function(i, table) {
var params = {};
var sc = Cookies.get('TS_'+$(this).attr('id').toUpperCase());
if (sc) {
sc = sc.split('|');
params = {sortList: [[sc[0],sc[1]=='asc'?'0':'1']]};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.