/**
* 数组排序
* list为数组 parm为排序字段 b为排序方向
*/
var _sort = function (list, parm, b) {
var down = function (x, y) {
return (eval("x." + parm) > eval("y." + parm)) ? -1 : 1;
}
var up = function (x, y) {
return (eval("x." + parm) < eval("y." + parm)) ? -1 : 1;
}
if (b == "down") {
list.sort(down);
}
else {
list.sort(up);
}
return list;
}