SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Command bar customization - Position ListView Command Set extension #7779

Open FlorianReinprecht opened 2 years ago

FlorianReinprecht commented 2 years ago

Hi,

is it possible to postion your own Command Set extensions?

I guess you would need to know the "key" of said extension? Or is this a limitation of this feature?

Thanks for your help.

BR


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ghost commented 2 years ago

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

AJIXuMuK commented 2 years ago

@FlorianReinprecht - what do you mean under "position"? You can use Sequence parameter similarly to classic custom actions. But it will not allow you to move your customizer before out of the box commands anyway.

FlorianReinprecht commented 2 years ago

HI @AJIXuMuK - yeah, I wanted to know, if this new Commandbar Formatting Feature would also work for moving the customizer before the OOTB commands.

Because it seems like I can move the OOTB commands behind the customizer with the help of the position property. (https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting#position)

Would have been nice to also use this for custom commands.

AJIXuMuK commented 2 years ago

@FlorianReinprecht - position property is not applicable for SPFx command sets.

necik11 commented 10 months ago

Hello, maybe a little late but it should be useful to someone else...

Here is an exact description of what you can edit and what you can't: You can't completely control the order in which the user custom actions show up; the user custom actions are added in the order the _api/web/Lists(guid'listid')/CustomActionElements returns the user custom actions, and this API currently does not take into account the sequence attributes. Buttons defined inside a custom tab can be ordered by adding them in the correct order in the CommandUIDefinition xml. Our sample shows Button 3 as first and that's because of the order in the XML.

If you already have the Command set deployed, you need to find out the id or Name, for example via: Get-PnPSiteTemplate or _api/web/Lists(guid'listid')/CustomActionElements and then modify via Invoke-PnPSiteTemplate or Set-PnPApplicationCustomizer -Identity "GuidOrName" -Sequence "10001" Lower Sequence higher importance.