格式化 SharePoint 列表视图

huangapple go评论60阅读模式
英文:

Formatting a sharepoint list view

问题

I am trying to do a couple of things in a SharePoint list but not getting anywhere. I wondered if you could help.

I am trying to firstly - work it so when someone hits the 'Submit' button (renaming of the 'exitGridView') it not only saves the submission but redirects to another URL? Is that possible with only using the custom JSON editor in SharePoint?

Secondly, it would be great if we could remove the 'Add new item' when in grid view so they can only see what's already there. Again, is this possible in the same way?

So far the JSON looks like this:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"additionalRowClass": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "%",
"operands": [
"@rowIndex",
2
]
},
0
]
},
"sp-css-backgroundColor-BgLightGray30",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "%",
"operands": [
"@rowIndex",
2
]
},
1
]
},
"sp-css-backgroundColor-noFill",
""
]
}
]
},
"commandBarProps": {
"commands": [
{
"key": "exitGridView",
"text": "Submit"
},
{
"key": "editInGridView",
"text": "Edit"
},
{
"key": "new",
"hide": true
},
{
"key": "export",
"hide": true
},
{
"key": "automate",
"hide": true
},
{
"key": "share",
"hide": true
},
{
"key": "integrate",
"hide": true
}
]
}
}

Any help would be greatly appreciated.

英文:

I am trying to do a couple of things in a sharepoint list but not getting anywhere. I wondered if you could help.

I am trying to firstly - work it so when someone hits the 'Submit' button (renaming of the 'exitGridView') it not only saves the submission but redirects to another url? Is that possible with only using the custom JSON editor in sharepoint?

Secondly, it would be great if we could remove the 'Add new item' when in grid view so they can only see whats already there. again is this possible in the same way?

so far the JSON looks like this:

    {
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "additionalRowClass": {
    "operator": ":",
    "operands": [
      {
        "operator": "==",
        "operands": [
          {
            "operator": "%",
            "operands": [
              "@rowIndex",
              2
            ]
          },
          0
        ]
      },
      "sp-css-backgroundColor-BgLightGray30",
      {
        "operator": ":",
        "operands": [
          {
            "operator": "==",
            "operands": [
              {
                "operator": "%",
                "operands": [
                  "@rowIndex",
                  2
                ]
              },
              1
            ]
          },
          "sp-css-backgroundColor-noFill",
          ""
        ]
      }
    ]
  },
  "commandBarProps": {
    "commands": [
      {
        "key": "exitGridView",
        "text": "Submit"
      },
      {
        "key": "editInGridView",
        "text": "Edit"
      },
      {
        "key": "new",
        "hide": true
      },
      {
        "key": "export",
        "hide": true
      },
      {
        "key": "automate",
        "hide": true
      },
      {
        "key": "share",
        "hide": true
      },
      {
        "key": "integrate",
        "hide": true
      }
    ]
  }
}

Any help would be greatly appreciated.

答案1

得分: 0

  1. 退出GridView按钮单击后使用视图格式化重定向到另一个URL是否可能?

    • 据我所知,不幸的是这是不可能的。
  2. 是否可以隐藏命令栏中的“添加新项”?

    • 是的,是可以的。您可以隐藏命令栏上的按钮,更改文本或图标等等。您可以在这里找到更多信息。

请不要忘记如果有帮助,请将其标记为答案。

英文:
  1. Is it possible to redirect to another URL after click on the exitGridView button using view formatting?
  • As far I know unfortunately it is not possible
  1. Is it possible to hide Add new item in Command bar?
  • Yes, it is possible. You can hide buttons on Command bar, change text or icon and many more. You will find more information here

Please do not forget mark this as answer if it helps you.

huangapple
  • 本文由 发表于 2023年2月24日 06:09:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/75550832.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定