Precision Healthcare Solutions
CLINICAL OFFICE MPAGE SUITE DEVELOPER REPORTS DESIGNER shopping_cart mail
SALES CONTACT US
Getting StartedCerner SetupDeveloper PC SetupGitHub Project TemplatesFull Page DeploymentWorkflow ComponentsComponents & DirectivesButtonConfirm DialogDate Range PickerDrop-DownEmbedded WorkflowIconInputInViewLogOptional TitlePatient SearchPrevent ScrollRadio ButtonsRemaining Screen SpaceResize ObserverScroll BarSelectTabbed MenuTableTreeModels & ServicesAddressAllergyCerner FunctionsCode ValueConfigCustom Custom Data DMInfoDiagnosisDialogEncounterLicenseMPageOrganizationPersonPersonnelPhoneProblemReferenceUtility

MPage Table Component

Overview

The MPage table component offers a simple one line option for transforming your Angular data objects into fully interactive tables. The table offers many advanced features which are all controlled through various settings you assign in your MPage code. The MPage table component dynamically adjusts its height and width to the available space of its parent container and works well with the remaining screen space directive. Column names are automatically converted to human-readable text (e.g. lastName becomes Last Name) and users can resize columns to any width they desire.

Required Imports

To use the MPage table in your component, you must import the MpageTableComponent from @clinicaloffice/mpage-developer and include it in your component imports array in your component TypeScript file.

e.g. your-component.ts

import {MpageTableComponent} from '@clinicaloffice/mpage-developer';

@Component({
  selector: 'your-component',
    imports: [MpageTableComponent],
  templateUrl: './your-component.component.html',
  styleUrl: './your-component.component.scss',
  standalone: true,
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class YourComponent {
}

Usage

At a minimum, the MPage table component requires a data object to render a table. For all examples in this document, we will be using an object array called tableData, however, you can also use signals and data arrays stored in any of the Clinical Office data services.

<mpage-table [data]="tableData" />

The table in the previous example has filled the entire content of the page and has scrolled off the bottom of the screen. Horizontally, an empty zone is displayed once the table data has been rendered.

The table will automatically allow sorting by clicking the column headers and can be filtered by entering values in the filter prompts below the titles. The filter prompts automatically determine the type of prompt to show based on the content and data field name.

Other text values can have search values typed in and clicking the prefix icon switches the filter search from "starts with" to "contains". This enables your users to have the ability to control how they search for text.

Columns which have object names ending with DtTm or Date will be treated as date values and offer extensive date range filtering.

If a text column on your table has a short list of unique values, a select drop-down will be used for the filter allowing multiple filter selections.

The MPage table is equipped with virtual scrolling when embedded in a parent container with a fixed size. In the next example, we nest the table component inside a div using the coRemainingScreenSpace directive. The table sizing is now completely responsive to any changes in the window size. Scrollbars appear only when needed to allow navigation in the table. The header row and filter row are locked in place and will always be visible.

<div coRemainingScreenSpace>
    <mpage-table [data]="tableData" />
</div>

When enabled with the allowSummary option in the params input, users can quickly summarize data by any field (or fields) on the table. In the example below, 10,000 rows of data have been summarized by province and city. Any data filters applied in the detail view are represented in the summary allowing for an incredible amount of user flexibility.

Options

The MPage table component offers several options for customization which are listed in the table below. Options can be applied directly in your HTML element.

<mpage-table [data]="tableData" (clickRow)="rowClicked($event) [params]="{showToolbar: true}" />
Option Binding Data Type Description
clickColumn Output event emitter Passes a column click event to the assigned method in the format of (clickColumn)="yourClickHandlerMethod($event)".

$event contains:

{
    "column": "Name of column clicked",
    "columnData": "Data inside of clicked column",
    "row": {Object containing entire row data was clicked on}
}
clickContextMenu Output event emitter Passes a context menu click event to the assigned method in the format of (clickContextMenu)="yourClickHandlerMethod($event)".

Note: Requires the contextMenu array to be populated in the params option.

$event contains:

{
    "contextMenuAction": "ID or Name of menu item clicked",
    ... all fields in row clicked ...
}
clickRow Output event emitter Passes a row click event to the assigned method in the format of (clickRow)="yourClickHandlerMethod($event)".

$event contains the entire row object.

columnConfig Input/Output IColumnConfig object The columnConfig option contains a detailed list of columns and sorting options that control how the table columns are displayed. If not assigned, a IColumnConfig object is automatically generated in the table. It is exposed here to allow you the ability to force a specific layout of the table.
data Input array object

This is the array that contains the data you wish to display in the table.

The table component does make assumptions concerning the data array being passed to it.

  1. Columns ending in Id or Cd are not displayed on the table unless specifically requested in the params option.
  2. Columns ending in DtTm or Date are treated as Date objects.
  3. Objects inside your data rows are ignored, however are passed on to the click events (e.g. clickRow)
filteredData Output event emitter

The filteredData event emitter makes all data in your table available with the user filters applied. For example, if you pass in an array with 1,000 different last names and search for "Simpson", only the rows with the last name of "Simpson" will be available in filteredData. We commonly use this emitter to export user filtered data outside the MPage to Excel.

To assign the filtered data to an array called fData you would add (filteredData)="fData = $event".

params Input ITableParams object The params object contains the customization options for the table component. The available options are numerous and discussed in detail further into this documentation.

Customizing the table parameters

The params input ITableParams object has been designed to allow maximum flexibility in how your table is displayed to end users. Every property in the params object is optional, meaning you only have to assign the values you want to change.

The properties are as follows:

Property Name Description Data Type Default Value
allowColumnSort Indicates if users can click the column title to sort data. boolean true
allowSummary Indicates if users can summarize table data in the pivot view. boolean undefined
allowWheelScroll Indicates if users can use the mouse wheel to scroll through the table. boolean true
autoResize Allows auto-resizing of table component. If set to false, the entire table is rendered. boolean true
averageDecimals When viewing summary data, determines the maximum number of decimals for average values. number undefined
columnFilter Enables or disables the filter row boolean true
columnStyleLogic The columnStyleLogic option gives you the ability to pass a function to your table for the purpose of changing styles of a table column. Your custom function must have two parameters. The first being a string parameter called column and a data parameter with an any type. Your function must return a data type of any.

The column parameter represents the name of the column being referenced in the call where data represents the entire row of data.

The returning data must be in a format usable by the style property in Angular. Care should be taken not to increase the height of a column or row as it will have a negative effect on table scrolling.

In the example below, we are setting the font to bold-underline on any column where the column name is equal to 'vip' and the vip column on the row is set to true.

protected myStyleLogic(column: string, data: any): any {
    if (data && column === 'vip' && data.vip) {
      return {
        fontWeight: '600',
        textDecoration: 'underline'
      }
    }
}
any undefined
columnStyleLogicProperties Contains any additional properties you may wish to use in your table column formatting.

The example below demonstrates a function passed to the columnStyleLogic property that makes use of addition data sent to the columnStyleLogicProperties to flex underline and mouse pointer settings based on specific actions.

This example is directly from the MPage Reports product where columns that have been assigned as clickable appear with underlines and a pointer when hovered. If row clicking has been assigned, the cursor will also appear as a pointer.

Your implementation will be different and unique to your solution.

protected myStyleLogic(column: string, data: any, columnStyleLogicProperties: any = undefined): any {
    if (data && columnStyleLogicProperties) {
        return {
            textDecoration: inList(column, columnStyleLogicProperties.actions) ? 'underline' : 'none',
            cursor: columnStyleLogicProperties.hoverAll || inList(column, columnStyleLogicProperties.actions) ? 'pointer' : 'inherit'
        }
    }
}
any undefined
contextMenu Assigns the right-click context menu content IMenuItem[] []
defaultToSummaryView When summary view has been enabled, indicates if the summary should be presented to users first. boolean undefined
dtTmLabel Label to display for Date/Time fields string "Date/Time"
emptyDateLabel Label to display if a Date/Time or Date field is empty string
enableCheckBoxes If set to true, any check box fields on the table will allow user interaction. Interactions are reflected in the (filteredData) emitter allowing for further action in your code. boolean false
extraToolbarButtons Allows you the ability to define additional buttons on the toolbar IMenuItem[] []
filterThreshold Assign the number of rows to allow before user has to hit enter key to filter content. number 1000
hideCdValues Hide columns ending with Cd boolean true
hideIdValues Hide columns ending with Id boolean true
hoverValue Determines if the content of a column should show as hover text. Useful as a quick display of data that is too long to be displayed. boolean true
listFilterSize Number of unique values before select list becomes a text search. number 15
maxInitialColumnWidth Determines the maximum size in pixels that a column width will auto-size to. number 300
noDataLabel Label to display if no data available for table. string No Results Available
noFilteredDataLabel Label to display if no data qualifies during user filtering. string No Results Qualified for Filter
showToolbar Indicates if toolbar should be shown to users. Exposing the toolbar offers users the ability to change the display properties and order of columns, perform multi-column sorting and more. boolean false
textJustification Assign the default text alignment of columns. Valid values are 'left','center','right' string 'left'
treatAllAsText Determines if all fields should be treated as simple text. boolean undefined

Automatic Field Name Handling

Field names in your data object determine how content is displayed on the table. Some field names will hide values, where others may display date formatting, an icon, or a checkbox.

The table below demonstrates the variations. In every case, the field name described ends with the value shown in the table (e.g. eventCd = Cd, event_cd = _cd). Any value not in the table below is treated as plain text.

Field titles will be derived from the field name. For example, name_full_formatted (nameFullFormatted) will display as "Name Full Formatted". Date/Time fields will display the dtTmLabel property in the params input in place of dtTm in the field name. (e.g. (CCL) inpatient_admit_dt_tm -> (JS) inpatientAdmitDtTm -> "Inpatient Admit Date/Time").

JavaScript Field Name CCL Record Structure Field Name Description
Cd _cd Code Value. Will not display on table unless hideCdValues in params set to false.
Chkbox _chkbox Will convert an integer 0/1 value to a checkbox on screen. In your CCL script, the record structure element for your _chkbox field needs to be an i4 type.

To allow users the ability to check/un-check the checkbox values you need to apply the enableCheckBoxes parameter.

Date _date Will format a Date/JS Date as a date without time.
DtTm _dt_tm Will format a Date/JS Date as a date/time string.
Icon _icon Will render an icon. Text in the field should be in the format of icon name paired with a color name and separated with a pipe delimiter (e.g. "person|primary"). Omitting the color portion will display the icon with the current text color (e.g. "person").
Id _id Cerner numeric Id. Will not display on table unless hideIdValues in params set to false.

Customizing Columns with columnConfig

Every MPage table object contains a columnConfig regardless of whether you assigned an object with the columnConfig option. If you have assigned an IColumnConfig object to your table with the columnConfig option, you have opened up the possibility to allow programmable customization.

<mpage-table [columnConfig]="myColumnConfig" />

IColumnConfig objects contain three arrays and several properties.

  • columns: <IColumn[]> contains the definition of each table column.
  • columnSort: <IColumnSort[]> lists the columns to be sorted.
  • maximumSummaryGroups?: number determines how many columns in columnSort should be used in summary calculations.
  • summaryCount?: boolean indicates if the sort groups should be totaled in the summary view.
  • summary?: ISummaryField[] specifies additional field calculations in the summary view.

Columns displayed in your table are displayed in order from left to right based on the position in the columns array. In the example below, columns will be displayed in the order of nurseUnit, patientName, mrn, and birthDate. Data will be sorted by nurseUnit and patientName, and if summarization is enabled, totals will be calculated for the nurseUnit field only.

const myColumnConfig: IColumnConfig = {
    columns: [
        { column: 'nurseUnit', label: 'Nurse Unit', type: 'Text', visible: true, sticky: true, width: 256, justification: 'left' },
        { column: 'patientName', label: 'Patient Name', type: 'Text', visible: true, sticky: true, width: 300, justification: 'left' },
        { column: 'mrn', label: 'Medical Record Number', type: 'Text', visible: true, sticky: false, width: 150, justification: 'center' },
        { column: 'birthDate', label: 'Birth Date', type: 'Date', visible: true, sticky: false, width: 200, justification: 'center' }
    ],
    columnSort: [
        { column: 'nurseUnit', sortDirection: 'asc' },
        { column: 'patientName', sortDirection: 'asc' }
    ],
    maximumSummaryGroups: 1,
    summaryCount: true,
    summary: []
}

If you do not include every field in your data object when assigning a custom column config, those fields will automatically be added to the IColumnConfig, however, the visible property will be set to false.

MPages we have designed for our clients typically assign columnConfig objects when we wish to allow saving user defined table configurations for MPage personalization. Our clients will run the MPage with the toolbar enabled, make whatever changes they want to column field ordering, column sizing and default sorting, and click a save button to save the values to a custom table. The next time they view the MPage, everything shows up the way the end user specified.

Context Menus and Extra Toolbar Buttons

Adding a right-click context menu and/or extra buttons to the toolbar is simple in the MPage table component.

To add a right-click context menu, you need to populate the contextMenu entry in your params object with an array of IMenuItem items. At a minimum, you need to populate a label value.

  • idName: Identifier name to pass back to the contextMenuAction property in the clickContextMenu emitter.
  • icon: Material Icon to display next to the label.
  • label: Label text to display in the menu. If idName is omitted, label will be passed to the contextMenuAction property. If a blank string is passed to the label, a separator bar will be displayed.
  • hoverText: Text to display when user hovers mouse over context menu row.

The example context menu below demonstrates the different display options available.

contextMenu: [
    {
      idName: 'med-info',
      icon: 'medical_information',
      label: 'Open Patient Chart',
      hoverText: 'Open the patient chart in PowerChart'
    },
    {
      label: ''
    },
    {
      icon: 'person',
      label: 'Patient Information'
    },
    {
      icon: 'biotech',
      label: 'Latest labs'
    },
    {
      icon: 'calendar_month',
      label: 'Upcoming Appointments'
    }
]

Extra buttons on the toolbar are also possible by assigning an IMenuItem[] array to your params.extraToolbarButtons object. The same properties are available as your context menu, however, the label property is not displayed. It will be passed to the contextMenuAction property in the clickContextMenu emitter if idName has not been assigned.

The extra buttons added to your toolbar only pass a value of contextMenuAction to the clickContextMenu emitter where a context menu additional sends the fields available on the row that was clicked when triggering the context menu.

extraToolbarButtons: [
    {
      idName: 'excel',
      icon: 'save_as',
      hoverText: 'Export to Excel'
    },
    {
      icon: 'help',
      label: 'Help',
      hoverText: 'Open help'
    }
]

Styling

The table below describes the styles specific to the MPage Table component that you can customize. These changes are global to your MPage. If you are building a component to be used in the Cerner MPage Component Framework, these styles are specific to your component and changes will have no impact on other Clinical Office components displayed on the same page.

SCSS Variable Name Default Value Description
--mpage-table-container-border
 
1px solid lightgrey
Perimeter border around the entire table.
--mpage-table-font-size inherit Font size of table content
--mpage-table-header-height 40px Height of the title header row on the table.
--mpage-table-header-background-color
 
rgb(124, 179, 198)
Table header row background color.
--mpage-table-row-height 36px Height of each row of table data
--mpage-table-background-color
 
white
Background color of table content.
--mpage-table-cell-border
 
1px solid lightgrey
Table cell border color.
--mpage-table-sort-arrow-color
 
grey
Color of up/down arrow in table header to indicate sorting.
--mpage-table-filter-background-color
 
whitesmoke
Background color of table filter rows.
--mpage-table-summary-level-1-background unset Background setting for summary level 1
--mpage-table-summary-level-1-border unset Border setting for summary level 1
--mpage-table-summary-level-1-color unset Text color setting for summary level 1
--mpage-table-summary-level-1-font-style unset Font Style setting for summary level 1
--mpage-table-summary-level-1-font-weight unset Font weight setting for summary level 1
--mpage-table-summary-level-1-font-size unset Font Size setting for summary level 1
All settings for --mpage-table-summary-level-1 are repeated for sort levels 2, 3 and 4.
--mpage-table-toolbar-box-height fit-content Change to 'unset' to have toolbar extend to the entire height of the table.
--mpage-table-toolbar-background-color
 
lightblue
Toolbar background color
--mpage-table-toolbar-border-radius 0 Set the roundness of the toolbar border.
--mpage-table-toolbar-box-shadow
 
2px 2px 4px rgba(0, 0, 0, 0.3)
Shadow around toolbar
--mpage-table-toolbar-icon-color
 
black
Toolbar icon color
--mpage-table-toolbar-icon-size 24px Size of icon displayed in the toolbar.
--mpage-table-toolbar-padding 8px Toolbar content padding
--mpage-table-toolbar-drag-background
 
lightgrey
Background color of draggable content inside the toolbar (e.g. Repositioning columns).
--mpage-table-toolbar-drag-padding 8px Padding around draggable content inside the toolbar.
--mpage-table-toolbar-drag-border unset Border around draggable content inside the toolbar.
--mpage-table-toolbar-drag-border-alternate 2px solid Border around draggable content inside the toolbar while user is hovering the mouse over the content.
--mpage-table-toolbar-drag-border-radius 0 Border radius (roundness) of draggable content inside the toolbar.
--mpage-table-empty-space-background
 
repeating-linear-gradient(-30deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.04) 4px, rgba(0, 0, 0, 0.08) 6px, rgba(0, 0, 0, 0.08) 10px)
Background to display in areas where there may be dead-space on the table.

Interfaces

ITableParams {
  allowColumnSort?: boolean;
  allowSummary?: boolean;
  allowWheelScroll?: boolean;
  autoResize?: boolean;
  averageDecimals?: number;
  columnFilter?: boolean;
  columnStyleLogic?: any;
  columnStyleLogicProperties?: any;
  contextMenu?: IMenuItem[];
  defaultToSummaryView?: boolean;
  dtTmLabel?: string;
  emptyDateLabel?: string;
  enableCheckBoxes?: boolean;
  extraToolbarButtons?: IMenuItem[];
  filterThreshold?: number;
  hideCdValues?: boolean;
  hideIdValues?: boolean;
  hoverValue?: boolean;
  listFilterSize?: number;
  maxInitialColumnWidth?: number;
  noDataLabel?: string;
  noFilteredDataLabel?: string;
  showToolbar?: boolean;
  textJustification?: string;
  treatAllAsText?: boolean;
}
IFilter {
    type: string;
    column: string;
    values: any[];
    search: any[];
}
IColumn {
    column: string;
    label: string;
    type: string;
    visible: boolean;
    sticky: boolean;
    width: number;
    justification: string;
}
IColumnSort {
    column: string;
    sortDirection: string;
}
IColumnConfig {
    columns: IColumn[];
    columnSort: IColumnSort[];
    maximumSummaryGroups?: number;
    summaryCount?: boolean;
    summary?: ISummaryField[];
}
IMenuItem {
    idName?: string;
    icon?: string;
    label?: string;
    hoverText?: string;
}
ISummaryField {
    column: string;
    calculation: string;
}
<< Prev: Tabbed Menu
Next: Tree >>
Copyright © 2026 Precision Healthcare Solutions