【问题标题】:Sharepoint Column Formatting - BasicSharepoint 列格式 - 基本
【发布时间】:2019-01-15 12:01:48
【问题描述】:

我有一个非常基本的共享点列表,其中包含 3 列,如下所示:

日期1 |日期2 | CalculatedDateDif(获取两个日期之间的月份 )
2018 年 1 月 1 日 | 2018 年 1 月 3 日 | 2
2018 年 1 月 1 日 | 2018 年 1 月 4 日 | 3

我正在使用默认的microsoft JSON code 格式化CalculatedDateDif 列以在值小于或等于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。

【问题讨论】:

    标签: json sharepoint formatting sharepoint-online


    【解决方案1】:

    进入列表设置,编辑CalculatedDateDif列,选择此公式返回的数据类型为单行文本,然后保存。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-23
      • 2020-04-11
      • 1970-01-01
      • 1970-01-01
      • 2018-04-18
      • 1970-01-01
      • 2022-11-29
      相关资源
      最近更新 更多