更新时间:2023-02-27 08:42:59
我认为您可以尝试创建自定义视图并通过CSR自定义视图.
您可以通过ctx.ListData.Row获取CSR中的所有数据.
然后实施逻辑来安排数据格式.
示例代码:
(function () {
'use strict';
SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
Templates: {
Header: function (ctx) {
return "<table>" +
"<thead>" +
"<tr>" +
"<td>FieldTitleA</td>" +
"<td>FieldTitleB</td>" +
"</tr>" +
"</thead>"
},
Body: function (ctx) {
var data = ctx.ListData.Row;
//the logic how you render your data.
return "<tr><td>1</td><td>1</td></tr>";
},
Footer: function (ctx) {
return "</table>";
}
}
});
})();
您可以在下面的线程中查看有关CSR的详细信息.
李