我想按如下方式格式化我的 Microsoft 列表:
我想将每隔一行设置为灰色,此外,当状态设置为“已完成”时,将完整行设置为绿色。
有人可以帮我处理 JSON 代码吗?
谢谢。
问候 菲尔
使用如下所示的 JSON 进行 SharePoint JSON 视图格式设置:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$Status]=='Completed','sp-field-severity--good',if(@rowIndex%2==0,'sp-css-backgroundColor-BgLightGray30','sp-css-backgroundColor-noFill'))"
}
其中
Status
是 SharePoint 列表列的 内部名称。您可以按照本文获取列的内部名称:如何在 SharePoint Online 中查找列的内部名称?
输出:
添加 JSON 的步骤: