This commit is contained in:
@@ -590,7 +590,14 @@ export default {
|
||||
// fruits.concat().sort(sortBy("name"));
|
||||
// => [{name:"apple", amount: 4}, {name:"banana", amount: 2}, {name:"mango", amount: 1}, {name:"pineapple", amount: 2}]
|
||||
sortByKey: key => {
|
||||
return (a, b) => (a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0);
|
||||
return (a, b) => {
|
||||
const aaa = a[key].toUpperCase();
|
||||
const bbb = b[key].toUpperCase();
|
||||
return aaa > bbb ? 1 : bbb > aaa ? -1 : 0;
|
||||
//this was the original but it was sorting weird as it was taking case into account with uppercase higher than lowercase
|
||||
//so PMItem came before Part in the object lists
|
||||
//return a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0;
|
||||
};
|
||||
},
|
||||
///////////////////////////////////////////////
|
||||
// "has" lodash replacement
|
||||
|
||||
Reference in New Issue
Block a user