如何使用group_name
[
{"fullname":"fffffffff","email":"sss@gg","mobile":"3333333333","designation":"ggg","group_name":"engineers"},
{"fullname":"ddddddddddd","email":"sssg@gg","mobile":"3333333333","designation":"fffff","group_name":"programmers "},
{"fullname":"hhhhhhhhh","email":"email@hotmail.com","mobile":"020202028347","designation":"programmer","group_name":"engineers"},
]
这里我将它动态地附加到表格。
jQuery的:
function (data) {
$("#view_table").ViewTable('option', 'data', data);
}
我设法将数据追加到表中,但无法对其进行分组,以及为什么它显示为未定义,如附图所示。
答案 0 :(得分:0)
您可以使用Underscore.js库来实现此目的。
var groupedData = _.groupBy(json, 'group_name');