Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

compare text

//Comparer Function    
function GetSortOrder(prop) {    
    return function(a, b) {    
        if (a[prop] > b[prop]) {    
            return 1;    
        } else if (a[prop] < b[prop]) {    
            return -1;    
        }    
        return 0;    
    }    
}    
    
array.sort(GetSortOrder("EmployeeName")); //Pass the attribute to be sorted on   
 
PREVIOUS NEXT
Tagged: #compare #text
ADD COMMENT
Topic
Name
3+1 =