Member Junction
    Preparing search index...

    EntityViewerComponent - Full-featured composite component for viewing entity data

    This component provides a complete data viewing experience with:

    • Switchable grid (AG Grid) and card views
    • Server-side filtering with UserSearchString
    • Server-side pagination with StartRow/MaxRows
    • Server-side sorting with OrderBy
    • Selection handling with configurable behavior
    • Loading, empty, and error states
    • Beautiful pagination UI with "Load More" pattern
    <!-- Basic usage - loads data automatically -->
    <mj-entity-viewer
    [Entity]="selectedEntity"
    (RecordSelected)="onRecordSelected($event)"
    (RecordOpened)="onRecordOpened($event)">
    </mj-entity-viewer>

    <!-- With external state control (like Data Explorer) -->
    <mj-entity-viewer
    [Entity]="selectedEntity"
    [ViewTypeID]="state.viewTypeId"
    [FilterText]="state.filterText"
    [SelectedRecordID]="state.selectedRecordId"
    (RecordSelected)="onRecordSelected($event)"
    (RecordOpened)="onRecordOpened($event)">
    </mj-entity-viewer>

    Hierarchy (View Summary)

    Implements

    • OnInit
    • OnDestroy
    • AfterViewInit
    Index

    Constructors

    Properties

    ActiveDynamicOption: ViewModeOption | null = null

    The currently-active view type's option (the plug-in being mounted). Null until the registry resolves / a type is selected. Drives the dynamic-mount host in the template.

    ActiveViewTypeKey: string | null = null

    The currently-active view type's stable key (descriptor Name). Null until the registry resolves.

    AfterViewTypeChange: EventEmitter<ViewTypeChangeEventArgs> = ...

    Emitted AFTER the active view type has changed (and, when AutoSaveView is on, after it has been persisted). Notification only.

    AfterViewTypeConfigChange: EventEmitter<ViewTypeConfigChangeEventArgs> = ...

    Emitted AFTER a plug-in renderer's configuration change has been applied (and persisted when AutoSaveView is on).

    AutoSaveView: boolean = false

    When true, the viewer persists view-type/config changes itself — to the loaded UserView record (when a ViewEntity/ViewID is present) or to per-user User Settings (the default-view case). When false (the default), the viewer only emits the Before…/After… events and the consumer is responsible for persistence. Persistence is provider-based (generic-safe) — never routing, which stays with the host app.

    AvailableViewTypes: ViewModeOption[] = []

    The view-type options shown in the switcher, sourced from ViewTypeEngine (the MJ: View Types registry), filtered by each descriptor's availability predicate. Every option is a dynamic-mounted plug-in.

    BeforeViewTypeChange: EventEmitter<ViewTypeChangeEventArgs> = ...

    Emitted (cancelable) BEFORE the active view type changes. A handler may set args.Cancel = true to veto the switch. Fires for both built-in and plug-in types.

    BeforeViewTypeConfigChange: EventEmitter<ViewTypeConfigChangeEventArgs> = ...

    Emitted (cancelable) BEFORE a plug-in renderer's configuration change is applied/persisted.

    ConfigureRequested: EventEmitter<void> = ...

    Bubbled up from a plug-in renderer asking the host to open this view's configuration UI (e.g. the grid's "Manage Columns" affordance). The host (the view workspace) owns the config panel; the container just forwards the request. See IViewRenderer.configureRequested.

    CreateRecordRequested: EventEmitter<void> = ...

    NAVIGATION request bubbled up from a plug-in renderer to create a new record of the current entity (e.g. a grid's "New" button). Opening the create form is a routing concern owned by the outer app; the container forwards it without acting on it.

    DataLoaded: EventEmitter<DataLoadedEvent> = ...

    Emitted when data is loaded

    DebouncedFilterText: string = ''
    FilteredCountChanged: EventEmitter<FilteredCountChangedEvent> = ...

    Emitted when filtered count changes

    FilteredRecordCount: number = 0
    FilterTextChange: EventEmitter<string> = ...

    Emitted when filter text changes (for two-way binding)

    HiddenFieldMatches: Map<string, string> = ...

    Track which records matched on hidden (non-visible) fields

    InternalFilterText: string = ''
    InternalRecords: Record<string, unknown>[] = []
    InternalSortState: SortState | null = null

    Current sort state

    IsLoading: boolean = false
    LoadingMessage: string = 'Loading...'
    OpenRelatedRecordRequested: EventEmitter<ViewRelatedRecordNavigation> = ...

    NAVIGATION request bubbled up from a plug-in renderer to open a related record on a (possibly different) entity — e.g. a grid foreign-key drill-through. Routing lives in the outer app, so this is one of the few signals that legitimately bubbles up. The container forwards it untouched.

    Pagination: PaginationState = ...

    Pagination state

    Provider: IMetadataProvider | null

    If specified, this provider will be used for communication and for all metadata purposes. By default, if not provided, the Metadata and RunView classes are used for this and the default GraphQLDataProvider is used which is connected to the same back-end MJAPI instance as the Metadata and RunView classes. If you want to have this component connect to a different MJAPI back-end, create an instance of a ProviderBase sub-class like GraphQLDataProvider/etc, and configure it as appropriate to connect to the MJAPI back-end you want to use, and then pass it in here.

    RecordOpened: EventEmitter<RecordOpenedEvent> = ...

    Emitted when a record should be opened (double-click or open button)

    RecordSelected: EventEmitter<RecordSelectedEvent> = ...

    Emitted when a record is selected (single click)

    ShowRecycleBin: boolean = true

    Whether to render the Recycle Bin chip in the viewer header. The chip auto-hides itself when the entity has no deleted records, doesn't track changes, or the user lacks Delete permission — so it stays out of the way on entities where it's not relevant.

    true
    
    TotalRecordCount: number = 0
    ViewTypeDropdownOpen: boolean = false

    Whether the view-type dropdown menu is currently open.

    ViewTypesFromRegistry: boolean = false

    Whether the registry (ViewTypeEngine) successfully sourced the available view types.

    "ɵdir": unknown
    "ɵfac": unknown

    Accessors

    • set EntityName(value: string | null): void

      Convenience input: the entity to display by name. Resolved internally to an EntityInfo via the active provider and applied through the entity setter. Use this OR [entity] OR [EntityID] — whichever is most convenient for the consumer.

      Parameters

      • value: string | null

      Returns void

    • get ProviderToUse(): IMetadataProvider

      Returns either the default Metadata provider or the one specified in the Provider property, if it was specified

      Returns IMetadataProvider

    • get RunQueryToUse(): IRunQueryProvider

      Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified

      Returns IRunQueryProvider

    • get RunReportToUse(): IRunReportProvider

      Returns either the default RunReport provider or the one specified in the Provider property, if it was specified

      Returns IRunReportProvider

    • get RunViewToUse(): IRunViewProvider

      Returns either the default RunView provider or the one specified in the Provider property, if it was specified

      Returns IRunViewProvider

    • set ViewID(value: string | null): void

      Convenience input: load and display a saved view by its MJ: User Views ID. The viewer loads the record via the active provider and applies it through the viewEntity setter (which also resolves the entity if [entity]/[EntityName]/[EntityID] weren't supplied).

      Parameters

      • value: string | null

      Returns void

    • set ViewTypeConfigs(
          value: { config: Record<string, unknown>; viewTypeId: string }[] | null,
      ): void

      Per-view-type configuration provided by the host (e.g. Explorer reading UserView.DisplayState.viewTypeConfigs). The active type is controlled separately via the viewMode / ViewTypeID inputs; this carries only the config payloads.

      Parameters

      • value: { config: Record<string, unknown>; viewTypeId: string }[] | null

      Returns void

    Methods

    • Export the current view's records via the active renderer's optional imperative export (IViewRenderer.exportRecords). Returns false when no renderer is mounted or the active view type doesn't support export (e.g. timeline/map). The grid renderer downloads the file itself; this is the no-UI entry point for an external driver (the AI agent).

      Parameters

      • Optionalformat: "csv" | "excel" | "json"

      Returns Promise<boolean>

    • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

      Returns void

    • Programmatically select a record — the no-UI equivalent of a user row-click. Highlights the row (by pushing SelectedRecordID down to the active renderer) AND emits RecordSelected so the host runs its selection path (open the detail panel, etc.). Returns false when there's no entity context. This is the entry point for an external driver (the AI agent's SelectRecord tool); the record must be one of the loaded rows.

      Parameters

      • record: Record<string, unknown>

        a record from the currently-loaded set

      Returns boolean

      true when selection was applied, false when no entity context is available

    • Selects a view type by its MJ: View Types row ID. This is the entry point used by external chrome (e.g. the workspace toolbar's ViewTypeSwitcherComponent) that surfaces the switcher outside the viewer's own header. Resolves the matching available option and applies it through the same lifecycle as a header-driven switch (cancelable events + persistence). No-op when the ID isn't an available view type or is already active.

      Parameters

      • viewTypeId: string | null

        the MJ: View Types row ID to switch to.

      Returns void