简体   繁体   English

Office Fabric UI自定义标头

[英]Office Fabric UI custom headers

I am using Office Fabric UI React Detaillist component. 我正在使用Office Fabric UI React Detaillist组件。 I want to add a heading on top of column headers like below: 我想在标题下方添加标题,如下所示:

在此处输入图片说明

Please help how to achieve this using offfice Fabric UI React. 请帮助使用offffice Fabric UI React实现此目的。 Reference offuce Fabric UI react detail list below: 参考提供了Fabric UI反应详细信息列表,如下所示:

https://developer.microsoft.com/en-us/fabric#/components/detailslist https://developer.microsoft.com/en-us/fabric#/components/detailslist

Docs on fabric ui are really outdated. Fabric ui的文档确实过时了。 While package is updated regularly (which is great). 软件包会定期更新(很棒)。

Consider looking through source code / examples on github for better understanding of this package. 考虑更好地了解github上的源代码/示例。

Looking at IColumn type at https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/DetailsList/DetailsList.types.ts#L299 https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/DetailsList/DetailsList.types.ts#L299中查看IColumn类型

it has 它有

   /**
   * If provided uses this method to render custom cell content, rather than the default text rendering.
   */
  onRender?: (item?: any, index?: number, column?: IColumn) => any;

which you can utilize to render header cell any way you like. 您可以利用它以任意方式呈现标头单元格。

Here are some examples 这里有些例子

https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/DetailsList/examples/DetailsList.CustomColumns.Example.tsx https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/DetailsList/examples/DetailsList.CustomColumns.Example.tsx

https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/DetailsList/examples/DetailsList.CustomGroupHeaders.Example.tsx https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/DetailsList/examples/DetailsList.CustomGroupHeaders.Example.tsx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM