Skip to content

@memberjunction/ng-query-viewer

Angular components for viewing and executing stored queries with parameter input, interactive AG Grid results, and entity linking. The recommended replacement for the deprecated @memberjunction/ng-query-grid.

Terminal window
npm install @memberjunction/ng-query-viewer

The Query Viewer provides a complete query execution experience: a parameter input form, an AG Grid results display, entity linking for clickable record IDs, and automatic state persistence to User Settings. It replaces the older Kendo-based Query Grid with a more feature-rich implementation.

flowchart TD
    subgraph Viewer["QueryViewerComponent"]
        A["QueryId Input"] --> B["Load Query Metadata"]
        B --> C["QueryParameterFormComponent"]
        C -->|Run| D["RunQuery API"]
        D --> E["QueryDataGridComponent"]
    end
    subgraph Features["Key Features"]
        F["State Persistence (User Settings)"]
        G["Parameter Persistence"]
        H["Entity Linking"]
        I["Export (Excel/CSV)"]
    end
    subgraph Grid["QueryDataGridComponent"]
        J["AG Grid"]
        K["Column Config"]
        L["Row Detail Panel"]
        M["Query Info Panel"]
    end

    E --> J
    E --> F
    C --> G
    J --> H

    style Viewer fill:#2d6a9f,stroke:#1a4971,color:#fff
    style Features fill:#7c5295,stroke:#563a6b,color:#fff
    style Grid fill:#2d8659,stroke:#1a5c3a,color:#fff
import { QueryViewerModule } from '@memberjunction/ng-query-viewer';
@NgModule({
imports: [QueryViewerModule]
})
export class YourModule {}
<mj-query-viewer
[QueryId]="selectedQueryId"
[AutoRun]="true"
(EntityLinkClick)="openRecord($event)">
</mj-query-viewer>
<mj-query-viewer
[QueryId]="queryId"
[AutoRun]="false"
[SelectionMode]="'multiple'"
[ShowInfoPanel]="true"
[ShowRowDetail]="true"
[PersistState]="true"
[PersistParams]="true"
(EntityLinkClick)="navigateToEntity($event)"
(SelectionChanged)="onSelectionChanged($event)"
(RowClick)="onRowClick($event)"
(GridStateChanged)="onStateChanged($event)">
</mj-query-viewer>
ComponentSelectorPurpose
QueryViewerComponentmj-query-viewerTop-level composite; orchestrates params, execution, and grid
QueryDataGridComponentmj-query-data-gridAG Grid wrapper with entity linking and export
QueryParameterFormComponentmj-query-parameter-formRenders input fields for query parameters
QueryRowDetailComponentmj-query-row-detailExpandable row detail display
QueryInfoPanelComponentmj-query-info-panelQuery metadata and execution info panel
PropertyTypeDefaultDescription
QueryIdstring | nullnullID of the query to execute
AutoRunbooleanfalseAuto-run when all required params have saved values
SelectionModeQueryGridSelectionMode'none'Row selection mode: 'none', 'single', 'multiple'
ShowInfoPanelbooleanfalseShow query metadata panel
ShowRowDetailbooleanfalseEnable expandable row detail
PersistStatebooleantrueSave grid state (sort, columns) to User Settings
PersistParamsbooleantrueSave parameter values to User Settings
EventTypeDescription
EntityLinkClickEventEmitter<QueryEntityLinkClickEvent>Clickable entity reference in a cell
SelectionChangedEventEmitter<QuerySelectionChangedEvent>Row selection changed
RowClickEventEmitter<QueryRowClickEvent>Row was clicked
GridStateChangedEventEmitter<QueryGridStateChangedEvent>Grid state changed (sort, filter, columns)
  • QueryGridSelectionMode'none' | 'single' | 'multiple'
  • QueryGridColumnConfig — Column definition with entity link info
  • QueryGridSortState — Current sort column and direction
  • QueryGridState — Full persisted grid state
  • QueryParameterValues — Map of parameter names to values
  • QueryGridVisualConfig — Visual configuration options
  • QueryExportOptions — Export format and configuration
  • QueryRowClickEvent — Row click event data
  • QueryEntityLinkClickEvent — Entity link click with entity name and record ID
  • buildColumnsFromQueryFields(fields) — Generates column config from query field metadata
  • buildColumnsFromData(data) — Generates column config by inspecting result data