Using the View Manager
The View Manager allows end-users to access, apply, edit, sort, and manage all the available table views, including Preset Views, public views, and global favorites. Depending on which views are enabled, the view manager can display up to five different sections:- User favorites (includes: favorited Preset Views, favorited User Views, and global favorite views)
- User views (non-favorited User Views)
- Preset views (non-favorited Preset Views)
- Public views (other user’s public views)
- Global views (global favorites that have been removed from the user’s favorites)
Action button
Next to each view is an action button that gives the user several options depending on the type of view:- Apply view
- Set as default/Remove as default (NEW!)
- Add to favorites/Remove from favorites
- Edit view (only displayed for the User Views created by the user)
- Delete view (only displayed for the User Views created by the user)
Sorting views
User favorites, User views, and Preset views can be sorted by clicking the up/down arrows and then dragging/dropping the view to the desired location. Each view will be confined to it’s section.Important: If the User Favorites section contains both Preset Views and User Views, Preset Views will always come first, followed by User Views. These two types of views can only be sorted within their respective groupings. In other words, Preset Views can only be sorted among other Preset Views, and User Views can only be sorted among other User Views.
View Manager configurations
Advanced Tables offers multiple ways to customize the View Manager. Unless specified otherwise, these options can be configured directly on theAdvancedTablesPlugin object inside your PanelProvider.
Changing the position in the Favorites Bar
By default, View Manager is displayed at the end of the Favorites Bar. You may position it at the start of the Favorites Bar using theviewManagerInFavoritesBar() method:
Displaying in the table toolbar
By default, View Manager is displayed in the Favorites Bar. You may display it in the toolbar by passingfalse to the viewManagerInFavoritesBar() method and adding the viewManagerInTable() method:
Changing the position in the table toolbar
By default, View Manager is displayed after the search field. You may display at any of the tooldbar positions available via Filament’s toolbar renderhooks by passing the renderhook to theposition property in the viewManagerInTable() method:
Customizing the trigger action
You can customize the View Manager trigger button usingviewManagerTriggerAction(), following the same pattern as Filament’s trigger action customization:
Displaying as a SlideOver
By default, View Manager is displayed as a dropdown. You may display it as a slideOver by adding theviewManagerSlideOver() method:
Dropdown vs slideOver internally
Internally, when displaying View Manager as a slideOver, Advanced Tables only has to query and select from the database the user’s favorite views as they are the only views show in the table. Since Filament only processes the content in slideOvers when they are triggered by an action button, the remaining views aren’t queried until the View Manager is triggered. This helps reduce unnecessary memory usage by selecting a smaller dataset from the database. However, this also means that when opening a slideOver there is a slight delay as Filament has to then query the database. On the flip side, when displaying the View Manager as a dropdown, Advanced Tables has to query and select all the available views from the database. This is because dropdowns already load all the data and are simply hidden and shown in Alpine. This in turn means that there is additional memory usage as all of the table’s views are queried from the database and loaded into memory. However, it also means that opening the dropdown is instant as opposed to having a delay with the slideOver. In most situations, the additional memory usage of the dropdown is worth the tradeoff to have the View Manager instantly available, but knowing how this works internally will help you decide which is best for your application.Disabling the View Manager
You may disable the View Manager globally by passingfalse to the viewManagerEnabled() method:
viewManagerIsEnabled() method on your List page:
Hiding the search field
By default the View Manager includes a search field to quickly search for views. You may disable the search field by passingfalse to the viewManagerSearch() method:
Displaying a Save View link
You may include a Save View link inside the View Manager with theviewManagerSaveView() method:
Note: This option is only available when the View Manager is displayed as a dropdown. When displaying the View Manager as a slideOver, viewManagerSaveView() has no effect.
Displaying a Reset link
You may include a Reset link inside the View Manager that functions the same as clicking theDefault View button with the viewManagerResetView() method:
Disabling Click to Apply
By default a user may click on any of the Views in the View Manager to apply that view’s configuration to the table. You may disable this by passingfalse to the viewManagerClickToApply() method:
Hiding the Apply button
By default a View’s action button includes anApply View button to apply that view’s configuration to the table. You may hide this by passing false to the viewManagerApplyButton() method:
Hiding the Active View Indicator
By default the View Manager will display an indicator next to the currently active view. You may hide this by passingfalse to the viewManagerActiveViewIndicator() method:
Displaying the Active View indicator a badge
By default the View Manager will display the active view indicator as a small green dot next to the current active view. You may change this to be a badge with theviewManagerActiveViewBadge() method:
Hiding the view type icons
Since different types of views have different available options, by default the View Manager will display view type icons next to each view. If you wish to hide these icons you can passfalse to the viewManagerViewTypeIcons() method:
Displaying view types as badges
If you prefer to display view types as badges instead of icons you can use theviewManagerViewTypeBadges() method:
Displaying both public and global view type indicators
By default, when a view is both public and a global favorite, the View Manager will only show the global favorite indicator, be it the icon or the badge. This helps reduce visual clutter as global favorites are already public. However, if you wish to display both you may do so with theviewManagerPublicIndicatorWhenGlobal() method:
Hiding the user icon
By default the View Manager will display the chosen icon for User Views and Preset Views in the View Manager. You may hide this icon in the View Manager with theviewIcon() method:
Changing the default view icon
If there is no icon associated with the User View or Preset View, a default icon will be shown in the View Manager. You may change which icon is displayed with thedefaultViewIcon() method: