Search
DashboardView Class
Remarks See Also
 






Represents the main view and controller for a dashboard.

Namespace: MindFusion.Dashboards
File: DashboardView.js

 Syntax

JavaScript  Copy Code

// class
DashboardView.prototype = {}

 Remarks

DashboardView is the top-level visual host control that attaches to an HTML DOM container element and manages the presentation, user interaction, theme synchronization, and layout execution of a dashboard. It acts as the primary entry point for integrating dashboards into web applications.

You instantiate a DashboardView by calling the static create method or invoking the constructor with a target HTML element:

JavaScript  Copy Code

var view = MindFusion.Dashboards.DashboardView.create(document.getElementById("dashboard"));


The DashboardView operates in one of two modes defined by the DashboardMode enumeration:

  • View: The runtime presentation mode where widgets are displayed cleanly in their assigned positions without designer adornments. End-user interactions, such as hovering over chart slices or scrolling data tables, are routed directly to the hosted widget controls.
  • Edit: The visual design-time authoring mode. In this mode, the DashboardView docks a DashboardPalette on the left and a PropertyGrid on the right. Empty grid cells are rendered as interactive drop targets with dashed borders. Users can drag new widget templates from the palette into cells, move existing widgets by dragging them, resize cards via selection handles, and delete the active widget by pressing the Delete or Backspace key.

The underlying data model is accessed through the dashboard property, an instance of the Dashboard class. A single Dashboard model can be shared between multiple views if necessary.

The theme property gets or sets the visual theme of the dashboard and its contained widgets. Assigning a theme name (such as "standard", "light", or "dark") updates the DOM classes on the host element, notifies all hosted widgets, and automatically synchronizes child palette and inspector panels.

To persist and restore dashboard configurations, use the toJson and fromJson methods. They serialize the active layout type, grid matrix dimensions, widget positions, and all internal widget settings into a JSON-compatible object.

The layout property specifies the active layout strategy, defined by the DashboardLayout enumeration (Grid or Diagram). The autoGrow property indicates whether the dashboard automatically generates additional grid rows when widgets are placed beyond the current row boundaries.

 Inheritance Hierarchy

MindFusion.Dashboards.Control
    MindFusion.Dashboards.UIControl
        MindFusion.Dashboards.DashboardView

 See Also