[Feature Request] Expose DetailList's DetailHeader component
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?
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!
Any news on this? As of 5.80.0, the component is still not exposed on the public API.
@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 I'd suggest headerAs.
@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
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!