Quantcast
Viewing all articles
Browse latest Browse all 82146

How do i use function fnPriority more times?

Hi,

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));
		};

Viewing all articles
Browse latest Browse all 82146

Trending Articles



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