Popup Windows

View as Markdown

Summary

  • AdapTable provides floating popup windows with your own content — separate from the Settings Panel and from AG Grid chrome
  • Windows are opened programmatically via User Interface API (openCustomWindowPopup) — there is no options registry of popups
  • They are movable and resizable; when a user changes position or size, AdapTable restores those dimensions the next time the same id opens
  • Content is render (AdapTable Vanilla) or frameworkComponent (React, Angular, Vue) on CustomWindowConfig

Hint

Popup windows suit auxiliary tools on a second monitor — filters, search panels, or inspectors — often opened from a Dashboard Button or Custom Toolbar.

Topics on this Page

TopicSummary
Open and closeopenCustomWindowPopup, closeCustomWindowPopup, header close button
CustomWindowConfigid, title, icon, position, size, content
Window contentPick your framework below — Vanilla, Angular, React, or Vue (FrameworkContent)
RelatedProgress Indicators for long-running operations

Open and close custom windows

Call userInterfaceApi.openCustomWindowPopup(config) with a CustomWindowConfig. The same API returns { close } so you can dismiss the window without storing the id.

const {close} = adaptableApi.userInterfaceApi.openCustomWindowPopup(config);
// later:
close();
// or:
adaptableApi.userInterfaceApi.closeCustomWindowPopup(config.id);

A close control is always shown in the window header (not configurable). Use closeCustomWindowPopup (or close()) from timeouts, after save, and so on.

Typical call sites: Custom Dashboard Button onClick, Custom Toolbar Button, or any code that already holds adaptableApi.

Deep Dive

The Custom Window object

Window content

The sections below depend on your AdapTable flavour. Each includes a demo that opens the window from a Dashboard button.

Developer Guide

Providing a Custom Window

const config: CustomWindowConfig = {
  id: 'demo_window',
  title: 'Demo Window',
  icon: 'laptop',
  position: {x: 100, y: 100},
  size: {width: 400, height: 300},
  render: context => {
    if (context.phase === 'onMount') {
      return '<div style="padding:10px"><p>Custom window content</p></div>';
    }
    return null;
  },
};
1
Create Custom Window Config

Build a CustomWindowConfig:

  • id — required unique identifier; pass the same value to closeCustomWindowPopup
  • title — label shown in the window header
  • icon — optional AdaptableSystemIconName for the header (e.g. 'laptop', 'search')
  • position — optional initial placement in pixels (x, y) — WindowPosition
  • size — optional initial dimensions (width, height) — WindowSize
  • render — function returning HTML; receives CustomRenderContext (phase, element, adaptableApi). Return markup on 'onMount'; return null on 'onDestroy'.

Users can move and resize the window at run time; AdapTable restores the last position and size when the window opens again.

Note

Open and close the window using Open and close custom windows — the demo button calls openCustomWindowPopup and auto-closes after 10 seconds.

Creating a Custom Window
Fork
  • This example contains a Custom Dashboard Button - Show Custom Window - which opens a Custom Window popup that displays the rendered content that was provided
  • The Custom Window is given an initial Size and Position but is also fully movable and resizable by the run-time user
  • The Custom Window contains a Close button for manual close, but is also set programmatically to close after 10 seconds (via closeCustomWindowPopup)
Try It Out
  • Click Show Custom Window — the window opens at the configured position and size; move and resize it as needed
  • Wait 10 seconds — the window closes automatically via closeCustomWindowPopup
  • Open it again — it restores the position and size you last set
Loading demo…

FAQ

Is this the same as Settings Panel popupType: 'window'? No. The Settings Panel is module configuration chrome. Popup windows are arbitrary content you open with CustomWindowConfig — tool panels, search UIs, inspectors, and so on.

Can I register popups in Adaptable Options? No. Build a CustomWindowConfig in code and call openCustomWindowPopup when needed.

Popup window vs Progress Indicator? Use a popup for interactive content the user can move or resize. Use a Progress Indicator for a blocking spinner/message during a long task (optional custom content there too).

Can I use the same id twice? id identifies the window instance for close and for restoring last position/size. Re-opening with the same id replaces or re-shows that logical window.