newObj.sort(function (a1, a2) {
var idx = 'issueSeverity';
//var idx = 1;
switch (idx) {
//case 0:
// a1[idx] = a1[idx].toString().toLowerCase();
// a2[idx] = a2[idx].toString().toLowerCase();
// break;
case 'issueSeverity':
a1[idx] = parseInt(a1[idx]);
a2[idx] = parseInt(a2[idx]);
break;
}
//return (a1[idx]<a2[idx]) ? -1 : ((a1[idx]>a2[idx]) ? 1 : 0);
return (a1[idx]>a2[idx]) ? -1 : ((a1[idx]<a2[idx]) ? 1 : 0);
});