首页 > 解决方案 > 如何隐藏 Sharepoint Framework 中 Asset Provisioning 创建的 Sharepoint 列表中的标题列?

问题描述

安装部署的 webpart 后,我​​需要 sharepoint 自动创建隐藏标题列或更改名称的列表。

标签: sharepointspfxsharepointframework

解决方案


为了在 spfx 中使用 elements.xml 提供一些项目,请检查以下步骤: https ://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/provision-sp- assets-from-package 要使标题列不需要和隐藏您需要添加将在其上构建列表的内容类型,并且在此 CT 中您需要将标题列引用为隐藏且不需要,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ContentType ID="0x010019DBC07DC85E425FAC393333BE5C537A" 
               Name="SomeCT" 
               Group="SomeGroup" 
               Description="Some CT" 
               Inherits="FALSE" Version="0">
    <FieldRefs>
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Hidden="TRUE" Required="FALSE" />      
    </FieldRefs>
  </ContentType>
</Elements>

推荐阅读