fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Feature Request] Expose DetailList's DetailHeader component

Open Nimelrian opened this issue 9 years ago • 6 comments

My use case: I want to replace the selection indicators (Checks) of DetailList with my own. For the body rows this is quite easy, since I can use the onRenderRow prop to render a DetailsRow where I can then inject my render logic using the onRenderCheck prop.

For the header, this is not possible, since the DetailsHeader component is not exposed and thus not available as an import via the component's index file.

Is it possible to either expose the component or offer another way to supply a custom function to render the check inside the header?

Nimelrian avatar Nov 06 '17 15:11 Nimelrian

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Fabric React!

stale[bot] avatar Apr 11 '18 07:04 stale[bot]

Any news on this? As of 5.80.0, the component is still not exposed on the public API.

Nimelrian avatar Apr 11 '18 08:04 Nimelrian

@dzearing - this sounds like a fair ask. How do you feel about adding a onRenderHeader prop like the onRenderRow we have? Or do you recommend the headerAs pattern?

aditima avatar May 04 '18 17:05 aditima

@aditima I'd suggest headerAs.

dzearing avatar Jul 02 '18 17:07 dzearing

@Nimelrian it looks like we have onRenderDetailsHeader in both 5.0 and 6.0 as of https://github.com/OfficeDev/office-ui-fabric-react/commit/1200d471c740de9b9a3c8b1e1257048f1cbcfb3f

5.0

https://github.com/OfficeDev/office-ui-fabric-react/blob/417807d02eafcee773cd409eb83baec03d31a944/packages/office-ui-fabric-react/src/components/DetailsList/DetailsList.types.ts#L178

6.0 https://github.com/OfficeDev/office-ui-fabric-react/blob/1204d4ea47fb7673016b1029bc1e0c2f2b2bba4e/packages/office-ui-fabric-react/src/components/DetailsList/DetailsList.types.ts#L186

Would that prop work for your use-case? Here's an example usage: https://codepen.io/kevintcoughlin/pen/wYjKKQ?editors=1010

KevinTCoughlin avatar Oct 18 '18 21:10 KevinTCoughlin

Now that you're saying it I'm actually not sure why I created this issue in the first place. I think one year ago I missed something about that callback (Probably didn't see the extends IDetailsHeaderBaseProps and VSCode Intellisense didn't help me out either, so I had no "easy" way of changing the selection check in the header. Just realized that I'm already using the callback and it fulfills my needs since I did a refactor on our internal list component some months ago.

I guess I can close this issue, sorry for the trouble!

Nimelrian avatar Oct 19 '18 06:10 Nimelrian