- function makeSortby(attribute) {
- return function(a, b) {
- if (a[attribute] != undefined && b[attribute] != undefined) {
- a = a[attribute]; //.toLowerCase();
- b = b[attribute];//.toLowerCase();
- if (a < b) return -1;
- if (a > b) return 1;
- return 0;
- }
- }
- }