json - Sharepoint 列格式 - 基本
问题描述
我有一个非常基本的共享点列表,其中包含 3 列,如下所示:
日期1 | 日期2 | CalculatedDateDif(获取两个日期之间的月份)
01/01/2018 | 2018 年 1 月 3 日 | 2
2018 年 1 月 1 日 | 2018 年 1 月 4 日 | 3
我正在格式化 CalculatedDateDif 列,以使用默认的Microsoft JSON 代码在值小于或等于 2 时显示错误图标!以下:
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"attributes": {
"class": "=if(@currentField <= 2,'sp-field-severity--warning', '')"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": "=if(@currentField <= 2,'Error', '')"
}
},
{
"elmType": "span",
"txtContent": "@currentField"
}
]
}
出于某种奇怪的原因,它格式化计算列下的所有行并从计算列中删除值。
我试图用@CalculatedDateDif 替换@currentField,但没有运气。
我正在在线使用 Sharepoint。
解决方案
推荐阅读
- xml - XML XPath 过滤器 Wordpress WPALLIMPORT
- doubly-linked-list - 如何在不重复的情况下在双向链表中插入元素?
- python - Python 代码每次运行重复 n+1 次
- node.js - Nodejs中的HandleBars分页
- javascript - 如何在多个html页面上声明一个变量
- tailwind-css - 如何在 tailwindcss 表中隐藏小型设备上的列?
- flutter - 我如何导航图像(包括图像上的文本)?
- scala - Scala 运行时错误:org.apache.spark.SparkException:无法执行用户定义的函数(Tokenizer$$Lambda$../..: (string) => array
) - amazon-web-services - AWS Cloud HSM 和 KMS 之间有什么区别?
- javascript - 是否可以使用 JavaScript 将输入值中的文本保存在 html 上并写入本地 txt 文件?