Member Junction
    Preparing search index...

    Module @memberjunction/ng-query-viewer - v5.49.0

    @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.

    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>
    Component Selector Purpose
    QueryViewerComponent mj-query-viewer Top-level composite; orchestrates params, execution, and grid
    QueryDataGridComponent mj-query-data-grid AG Grid wrapper with entity linking and export
    QueryParameterFormComponent mj-query-parameter-form Renders input fields for query parameters
    QueryRowDetailComponent mj-query-row-detail Expandable row detail display
    QueryInfoPanelComponent mj-query-info-panel Query metadata and execution info panel
    Property Type Default Description
    QueryId string | null null ID of the query to execute
    AutoRun boolean false Auto-run when all required params have saved values
    SelectionMode QueryGridSelectionMode 'none' Row selection mode: 'none', 'single', 'multiple'
    ShowInfoPanel boolean false Show query metadata panel
    ShowRowDetail boolean false Enable expandable row detail
    PersistState boolean true Save grid state (sort, columns) to User Settings
    PersistParams boolean true Save parameter values to User Settings
    Event Type Description
    EntityLinkClick EventEmitter<QueryEntityLinkClickEvent> Clickable entity reference in a cell
    SelectionChanged EventEmitter<QuerySelectionChangedEvent> Row selection changed
    RowClick EventEmitter<QueryRowClickEvent> Row was clicked
    GridStateChanged EventEmitter<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

    Classes

    QueryDataGridComponent
    QueryInfoPanelComponent
    QueryParameterFormComponent
    QueryRowDetailComponent
    QueryViewerComponent
    QueryViewerModule

    Interfaces

    OpenQueryRecordEvent
    QueryEntityLinkClickEvent
    QueryExportOptions
    QueryGridColumnConfig
    QueryGridSortState
    QueryGridState
    QueryGridStateChangedEvent
    QueryGridVisualConfig
    QueryParameterValues
    QueryRowClickEvent
    QuerySelectionChangedEvent
    RowDetailEntityLinkEvent
    TargetEntityInfo

    Type Aliases

    QueryGridHeaderStyle
    QueryGridSelectionMode

    Variables

    DEFAULT_QUERY_VISUAL_CONFIG

    Functions

    buildColumnsFromData
    buildColumnsFromQueryFields
    getQueryGridStateKey
    getQueryParamsKey
    resolveTargetEntity