Adaptable

#UI Components

<adaptable-ui> and the components below are the parts the full product is made of, each usable on its own. Place them anywhere inside <adaptable-provider>, in the same template: they all work on the same state, so a part in your app header and one in a sidebar stay in sync with each other and with the grid. Each is a standalone component, exported by its class name (AdaptableUI, AdaptableDataGrid, AdaptableViewPicker, …): list the classes in the imports of your component.

#<adaptable-ui>

<adaptable-ui /> renders the grid with the four dashboard bars around it, plus the overlays: the settings panel in a dialog, notification toasts and cell note popovers. It is the same as <adaptable-dashboard> around <adaptable-data-grid>, followed by <adaptable-overlays>. Its element renders nothing of its own, so it takes className and layoutStyle (the style of its box) as inputs; they are listed in the Adaptable.UI reference.

#The grid and the dashboard

  • <adaptable-data-grid> — just the grid, with no dashboard and no overlays.
  • <adaptable-dashboard> — the dashboard bars around its content (usually the grid). [slots]="false" leaves the bars out. <adaptable-dashboard-top>, -bottom, -left and -right render a single bar anywhere. See Dashboard.
  • <adaptable-overlays> — the settings panel dialog, notification toasts and cell note popovers. They open on top of the page, so it can go anywhere inside the provider.
Note

<adaptable-ui> includes the overlays. With <adaptable-data-grid> (on its own or inside <adaptable-dashboard>), render <adaptable-overlays /> once in your layout; without it, notifications and cell notes don't show and the dashboard's settings buttons have no dialog to open.

#Pickers and editors

  • <adaptable-view-picker> (AdaptableViewPicker) — a dropdown of the views. It takes size, placeholder, disabled and className, as the Select does.
  • <adaptable-quick-search> (AdaptableQuickSearch) — the quick search input. See Quick Search.
  • <adaptable-column-chooser> (AdaptableColumnChooser) — pick and reorder the columns of the current table view. variant is 'default' or 'basic'.
  • <adaptable-grouping-editor> (AdaptableGroupingEditor) — row grouping for the current table view.
  • <adaptable-pivot-editor> (AdaptablePivotEditor) — the pivot columns of the current pivot view.

ColumnChooser and GroupingEditor render nothing while a pivot view is active, and PivotEditor renders nothing for a table view.

#The settings panel

<adaptable-settings-panel> (AdaptableSettingsPanel) is the full settings panel: a searchable sidebar, plus one page per feature. Embed it in a drawer, a dialog or a page section, or let <adaptable-workspace> place it beside the grid.

  • defaultItemId — the page shown first (default 'views'); see the settings page ids.
  • headerExtra — content at the far end of the page header, such as a close button: an element of the content with the headerExtra attribute (<button headerExtra (click)="close()">Close</button>), or something to render passed to the [headerExtra] input.
  • [(itemId)] — control the page (the model itemId, with (itemIdChange)).

While a settings panel is mounted, adaptableApi.settingsPanelApi.showSettingsPanel() (also called by the dashboard's settings buttons) switches it to the requested page instead of opening the settings dialog.

#Settings pages on their own

Each settings page is also a component, so you can embed just the one you need:

  • View editors, for the current view: ViewManager, ViewColumnsEditor, ViewPivotColumnsEditor, ViewSortingEditor, ViewGroupingEditor, ViewAggregationsEditor, ViewGridFilterEditor, ViewSelectionEditor.
  • Feature managers: CalculatedColumnsManager, NamedQueriesManager, ReportsManager, StyledCellsManager, FlashingCellsManager, CellNotesManager, AlertsManager, ThemeManager, DashboardManager.

In a template, each is the element named after its class: ViewSortingEditor is <adaptable-view-sorting-editor>, ThemeManager is <adaptable-theme-manager>, CellNotesManager is <adaptable-cell-notes-manager>, and so on.

They all take className. ViewColumnsEditor also takes showPinning, showSizing, showRename, showAddColumn and showDataTypeQuickSelect to hide parts of each column row, and showInspector to hide the column inspector (all true by default).

#
A settings page above the grid

<adaptable-view-sorting-editor> at the top edits the sorting of the current view; <adaptable-dashboard> and <adaptable-data-grid> below show it. Change the sort order in the editor, or click a column header, and the other one follows.

open
loading demo…

To build editors of your own, use the feature inject functions (injectViewColumns(), injectColumnSorting(), injectStyledCells(), …, the Angular counterparts of the hooks) — the built-in editors use the same ones.

#Replacing built-in parts

To replace a built-in view editor everywhere it appears, the settings panel included, pass your own through the components prop: ViewColumnsEditor, ViewSortingEditor, ViewGroupingEditor, ViewAggregationsEditor, ViewGridFilterEditor, ViewSelectionEditor and ViewPivotColumnsEditor. The same prop also replaces:

  • AdaptableObjectEditorDialog — the container for creating and editing an Adaptable object (a calculated column, a styled cell, …), also used by the settings dialog. The default is a modal dialog; pass a drawer, a page or any other container. The built-in one is <adaptable-object-editor-dialog> (AdaptableObjectEditorDialog).
  • Notification — the toast that shows an alert notification.

In Angular, each of these is a component class or an <ng-template> (read with viewChild). A component gets the props of the part it replaces as inputs of the same names (the ones it declares), and an output x of it calls the prop onX; a template gets the props as its context (let-value="value").