pnp / List-Formatting

List Formatting Samples for use in SharePoint and Microsoft Lists
https://pnp.github.io/List-Formatting/
MIT License
1.78k stars 853 forks source link

Is it possible to format Custom Listview command buttons #554

Closed navpreetkaur91 closed 2 years ago

navpreetkaur91 commented 2 years ago

I have custom button on toolbar from https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api. Is it possible to hide these?

thechriskent commented 2 years ago

Unfortunately, not with formatting. The Command Set customization options only apply to the out of the box options.

However, an SPFx Listview CommandSet can use the onListViewUpdated method to conditionally decide if the command should be shown based off of the list, items selected, permissions, etc. The image used can also be conditionally set (not just configured in the manifest). Unfortunately, things like the order are not settable for commandsets.

navpreetkaur91 commented 2 years ago

Thanks for the reply. Looking forward for something like this may be a new feature in future.