Update: Update the header renderer for the DataTables 1.10 updated

parameter list
pull/40/head
Allan Jardine 11 years ago
parent f3e99a6c02
commit 2cf85d1ccd

@ -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 ) {
$('<div/>')
.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
);
} );
}
};
/*

Loading…
Cancel
Save