Skip to content

@memberjunction/ng-find-record

An Angular component library for searching and selecting records from any MemberJunction entity. Provides both a standalone search component and a dialog wrapper for modal usage.

Terminal window
npm install @memberjunction/ng-find-record

The Find Record package provides a reusable search interface that works with any entity registered in the MemberJunction metadata system. It uses debounced search input with the RunView API and displays results in a Kendo UI grid for easy selection.

flowchart LR
    subgraph Input["User Input"]
        A["Search Text"] --> B["Debounce (300ms)"]
    end
    subgraph API["MJ Data Layer"]
        B --> C["RunView + UserSearchString"]
        C --> D["BaseEntity Results"]
    end
    subgraph Display["UI Components"]
        D --> E["Kendo Grid"]
        E --> F["OnRecordSelected"]
    end

    style Input fill:#2d6a9f,stroke:#1a4971,color:#fff
    style API fill:#7c5295,stroke:#563a6b,color:#fff
    style Display fill:#2d8659,stroke:#1a5c3a,color:#fff
import { FindRecordModule } from '@memberjunction/ng-find-record';
@NgModule({
imports: [FindRecordModule]
})
export class YourModule {}
<mj-find-record
[EntityName]="'Users'"
[SearchDebounceTime]="500"
(OnRecordSelected)="handleRecordSelected($event)">
</mj-find-record>
<mj-find-record-dialog
[EntityName]="'Users'"
[DialogTitle]="'Find User'"
[DialogVisible]="showFindDialog"
(DialogClosed)="handleDialogClosed($event)"
(OnRecordSelected)="handleRecordSelected($event)">
</mj-find-record-dialog>
ComponentSelectorPurpose
FindRecordComponentmj-find-recordStandalone search with results grid
FindRecordDialogComponentmj-find-record-dialogModal dialog wrapper around the search component
PropertyTypeDefaultDescription
EntityNamestring''Name of the MemberJunction entity to search
DisplayFieldsEntityFieldInfo[][]Fields to display in the results grid. Defaults to fields marked as DefaultInView, IsPrimaryKey, IsNameField, or IncludeInUserSearchAPI
SearchDebounceTimenumber300Debounce time in milliseconds for search input
EventTypeDescription
OnRecordSelectedEventEmitter<BaseEntity>Emitted when a user selects a record from the grid

Inherits all inputs from FindRecordComponent, plus:

PropertyTypeDefaultDescription
DialogTitlestring'Find Record'Title displayed in the dialog header
DialogWidthstring'700px'Width of the dialog
DialogHeightstring'450px'Height of the dialog
DialogVisiblebooleanfalseControls dialog visibility
SelectedRecordBaseEntity | nullnullPre-selected record
EventTypeDescription
DialogClosedEventEmitter<boolean>true if OK was clicked, false if cancelled
  1. User types in the search input; input is debounced (default 300ms)
  2. A search executes via RunView with UserSearchString and ResultType: 'entity_object'
  3. Results display in a Kendo UI grid with the configured display fields
  4. Clicking a row emits the selected BaseEntity instance via OnRecordSelected