按首字母排序文档
1.确认信息结构图有首字母排序的字段
2.页面数据绑定
3.插标准查询代码段中设置sort为true,再设置排序条件
4.按首字母排序
function() {
tmp_data.tzmlb = _.map(tmp_data.tzmlb, function(value) { value.szm1 = value._sort[0].charAt(0); value.yonghuxinxibiao7namesortfi = value.szm1.toUpperCase(); return value;
});
tmp_data.newtzmlb = _.groupBy(tmp_data.tzmlb, function(ele) {
return _.isObject(ele) ? ele["yonghuxinxibiao7namesortfi"] : "unclassify";
});
tmp_data.keysarray = _.keys(tmp_data.newtzmlb);
tmp_data.valuesarray = _.values(tmp_data.newtzmlb);
tmp_data.result = tmp_data.result || [];
_.each(tmp_data.keysarray, function(v, k, l) {
tmp_data.result.push({
"yonghuxinxibiao7namesortfi": v,
"tzmlb": tmp_data.valuesarray[k]
});
});
finish_data._runCommand = finish_data._runCommand || [];
finish_data._runCommand.push({
"command": "updatelv",
"params": [{
"zxrlb": tmp_data.result
}]
});
},