From 2cf85d1ccdbd10096b6bd55569f4eaf0dcfb5029 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 13 Feb 2014 09:54:16 +0000 Subject: [PATCH] Update: Update the header renderer for the DataTables 1.10 updated parameter list --- integration/jqueryui/dataTables.jqueryui.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/integration/jqueryui/dataTables.jqueryui.js b/integration/jqueryui/dataTables.jqueryui.js index 3575e82..0e80007 100644 --- a/integration/jqueryui/dataTables.jqueryui.js +++ b/integration/jqueryui/dataTables.jqueryui.js @@ -44,7 +44,7 @@ $.extend( DataTable.ext.classes, { } ); -DataTable.ext.renderer.header.jqueryui = function ( settings, cell, column, idx, classes ) { +DataTable.ext.renderer.header.jqueryui = function ( settings, cell, column, classes ) { $('
') .addClass( 'DataTables_sort_wrapper' ) .append( cell.contents() ) @@ -55,10 +55,12 @@ DataTable.ext.renderer.header.jqueryui = function ( settings, cell, column, idx, // Attach a sort listener to update on sort $(settings.nTable).on( 'order.dt', function ( e, settings, sorting, columns ) { + var colIdx = column.idx; + cell .removeClass( classes.sSortAsc +" "+classes.sSortDesc ) - .addClass( columns[ idx ] == 'asc' ? - classes.sSortAsc : columns[ idx ] == 'desc' ? + .addClass( columns[ colIdx ] == 'asc' ? + classes.sSortAsc : columns[ colIdx ] == 'desc' ? classes.sSortDesc : column.sSortingClass ); @@ -72,13 +74,13 @@ DataTable.ext.renderer.header.jqueryui = function ( settings, cell, column, idx, sort_prefix+'carat-1-n' +" "+ sort_prefix+'carat-1-s' ) - .addClass( columns[ idx ] == 'asc' ? - sort_prefix+'triangle-1-n' : columns[ idx ] == 'desc' ? + .addClass( columns[ colIdx ] == 'asc' ? + sort_prefix+'triangle-1-n' : columns[ colIdx ] == 'desc' ? sort_prefix+'triangle-1-s' : column.sSortingClassJUI ); } ); -} +}; /*