I'm newbie in developing SPFX extensions. I'm trying to add a CommandSet that toggles the view in a list. For example, I want to assign for 'Command Two' event to view 'All items'. Is it possible to assign an event to switch saved displays in a Sharepoint List? Any idea how how can this be implemented?
Command Set is not suitable for changing the list view, It is something that will work on item level or item selection to run some custom code.
And it can be displayed in list menu and context menu.
It can be used with some scenario like.
- Moving selected item to another list.
- Display dialog on item selection for some type customization.
For changing the list view you can use out of box functionality.