sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Spfx Extension Field Customizer default fallback support 2

Open matthong opened this issue 7 years ago • 9 comments

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.

matthong avatar Apr 09 '19 15:04 matthong

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Apr 09 '19 15:04 msft-github-bot

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

andrewconnell avatar Apr 09 '19 16:04 andrewconnell

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 avatar Apr 09 '19 18:04 matthong

@matthong Could you show how you resolved this issue, your workaround? I've voted up for this feature also.

23W avatar Nov 08 '19 09:11 23W

@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 avatar Nov 08 '19 13:11 matthong

@matthong Thank you

23W avatar Nov 08 '19 13:11 23W

@andrewconnell It looks like Field Customizer doesn't work in Tiled mode of Documents List View. Am I right?

23W avatar Nov 08 '19 16:11 23W

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.

nse7ens avatar Jan 07 '20 12:01 nse7ens

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

msft-github-bot avatar Jan 24 '20 18:01 msft-github-bot