Hi,
How do i use function fnPriority more times?
This code do not work (work only second fnPriority).
How do i use function fnPriority more times?
This code do not work (work only second fnPriority).
function fnPriority( a ) { if ( a == 'mega' ) { return 1; } else if ( a == 'giga' ) { return 2; } else if ( a == 'tera' ) { return 3; } return 0; } function fnPriority( a ) { if ( a == 'slow' ) { return 1; } else if ( a == 'normal' ) { return 2; } else if ( a == 'fast' ) { return 3; } return 0; } jQuery.fn.dataTableExt.oSort['priority-asc'] = function(a,b) { var x = fnPriority( a ); var y = fnPriority( b ); return ((x < y) ? -1 : ((x > y) ? 1 : 0)); }; jQuery.fn.dataTableExt.oSort['priority-desc'] = function(a,b) { var x = fnPriority( a ); var y = fnPriority( b ); return ((x < y) ? 1 : ((x > y) ? -1 : 0)); };