Spfx Extension Field Customizer default fallback support 2
Category
- [X] Question
- [ ] Typo
- [ ] Bug
- [X] Additional article idea
Expected or Desired Behavior
In a Field Customizer , it would be nice to have a default implementation for the onRenderCell() function to return the default html element as a fallback option, instead of setting the column blank.
A same topic was created a few months ago but was closed due to lack of activity. https://github.com/SharePoint/sp-dev-docs/issues/3039
We have a requirement to customize the DocIcon field for a special document type (with .xyz as file extension for example). We want to use the field customizer to render a custom icon for all XYZ files only. The issue is that there is no default implementation so we have to render icons for other files like PDFs and DOCXs or they will be blank. It will be great if I the super.onRenderCell(event) function can return the default html element.
BTW, seems that it is not an easy task to find correct icons for file types in a modern document library. I tried the FileTypeControl in @pnp/spfx-controls-react but it misses quite a few icons. Then I tried the "office-ui-fabric-react" but had difficulty in mapping file types with icon names.
Observed Behavior
The field is blank if not custom implementation is provided.
Steps to Reproduce
Create a HelloWorld field customizer and don't implement the onRenderCell() function.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Good suggestion, but this would fall in the category of a feature request. As the new issue template stated, these are best submitted to User Voice: https://aka.ms/sp-dev-uservoice
There is a request in UserVoice already. https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/31530607-field-customizer-ability-to-call-ootb-render-meth
@matthong Could you show how you resolved this issue, your workaround? I've voted up for this feature also.
@matthong Could you show how you resolved this issue, your workaround? I've voted up for this feature also.
We haven't found a good workaround for this issue yet.
@matthong Thank you
@andrewconnell It looks like Field Customizer doesn't work in Tiled mode of Documents List View. Am I right?
This would indeed be very useful. Our use case: a required field should keep rendering the "Required info" warning message when no data is filled in, but render the data in a different way when there is data available.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues