Sharepoint列表自定义JSON视图未在列表Web部件中正确显示

问题描述 投票:0回答:1

我有一个自定义JSON列表视图,该视图可正确显示为列表,但未在列表Web部件中保留其格式。几周前我创建它时还可以,但是发生了一些变化(也许是Sharepoint更新?)

This is how it looks as list

And this is how it looks in web-part

我想使其在Web部件中更紧凑,并且没有标题。

这是我的JSON代码,几周前正确运行。现在似乎在web-part中忽略了hideColumnHeader和height标签。

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "hideSelection": true,
  "hideColumnHeader": true,
  "rowFormatter": {
    "elmType": "a",
    "txtContent": "@currentField",
    "attributes": {
      "class": "sp-field-fontSize14  ms-fontColor-neutralPrimary ms-fontColor-red--hover",
      "href": "[$Link]"
    },
    "style": {
      "text-decoration": "none",
      "width": "300px",
      "min-width": "200px",
      "min-height": "1em",
      "height": "1em",
      "white-space": "nowrap",
      "padding-left": "=if(indexOf(@currentField, ' ') == 1, '', if(indexOf(@currentField, ' ') == 3, '20px', '40px'))"
    }
  }
}

我正在使用SharePoint Online的现代体验。修复此问题的任何帮助将不胜感激!

我有一个自定义JSON列表视图,该视图可正确显示为列表,但未在列表Web部件中保留其格式。几周前我创建它时还可以,但是发生了一些变化(也许...

css json sharepoint sharepoint-list
1个回答
0
投票

作为一种解决方法,我们可以将以下CSS样式添加到modern script editor webpart

© www.soinside.com 2019 - 2024. All rights reserved.