Module

GridHelpers

Methods

# static addBasicFormatting(muiGridColumn)

This function provides the basic formatting. We do not need to provide a getter or formatter for basic fields If the editable flag is set to true then we will set the editable property to true and provide a valueSetter
Parameters:
Name Type Description
muiGridColumn Object

View Source helpers/gridHelpers.js, line 167

# static addDateFormatting(muiGridColumn)

This takes a mui column and adds formatting to it to handle date fields
Parameters:
Name Type Description
muiGridColumn Object The column from the layout
See:

View Source helpers/gridHelpers.js, line 185

# static addSingleSelectFormatting(muiGridColumn, layoutColumn)

This takes a mui column and adds formatting to it to handle single select fields. It extracts the possible values from the layout column and adds them to the column config as choices The filter uses these choices to filter the data
Parameters:
Name Type Description
muiGridColumn Object The column used by the MUIGrid component
layoutColumn Object The column from the layout
See:

View Source helpers/gridHelpers.js, line 224

# static baseColumnConfig(column) → {Object}

This is the base config for a column that is used by the MUIGrid component It takes a column from the layout and converts it into a config that can be used by the MUIGrid component
Parameters:
Name Type Description
column LayoutColumn The column from the layout
See:

View Source helpers/gridHelpers.js, line 15

- The column config for the MUIGrid component
Object

# static getDateOrDefault(value, defaultValue) → {object}

This function provides a date value or a default value if the date is null or undefined It is used to render the cell as 'N/A' if the date is null or undefined
Parameters:
Name Type Description
value Date | String
defaultValue String

View Source helpers/gridHelpers.js, line 108

object

# static getDateOrDefaultFormatted(value, defaultValue) → {String}

This function provides a date value or a default value if the date is null or undefined. The returned date is formatted as a string according to the common dateFormatter for the entire app.
Parameters:
Name Type Description
value Date | String
defaultValue String
See:
  • dateFormatter
  • getDateOrDefault

View Source helpers/gridHelpers.js, line 133

String

# static getValueNameOrDefault(value, defaultValue) → {String}

This provides a name value or a default value if the name is null or undefined It is used to render the cell as 'N/A' if the object or name is null or undefined
Parameters:
Name Type Description
value Object The object that contains the name
defaultValue String The default value to return if the name is null or undefined

View Source helpers/gridHelpers.js, line 147

String

# inner addActionButtonFormatting(muiGridColumn, actionData)

This takes a mui column and adds formatting to it to handle action button fields
Parameters:
Name Type Description
muiGridColumn object The column used by the MUIGrid component
actionData ActionData The action data from the layout

View Source helpers/gridHelpers.js, line 308

# inner addCurrencyFormatting(muiGridColumn)

Parameters:
Name Type Description
muiGridColumn object The muiGridColumn to add the formatting to

View Source helpers/gridHelpers.js, line 201

# inner addExternalLinkFormatting(muiGridColumn)

This takes a mui column and adds formatting to it to handle external link fields It generates a link to the external link
Parameters:
Name Type Description
muiGridColumn Object The column used by the MUIGrid component
See:

View Source helpers/gridHelpers.js, line 291

# inner addObjectReferenceFormatting(muiGridColumn, linkFormat)

This takes a mui column and adds formatting to it to handle object reference fields It generates a link to the object reference
Parameters:
Name Type Description
muiGridColumn Object The column used by the MUIGrid component
linkFormat Object The column from the layout - TODO: This isnt true as we destructured the linkFormat from the layout column

View Source helpers/gridHelpers.js, line 259

# inner convertLayoutColumnToMuiColumn(column) → {MuiGridColumn}

This function takes a layout column and returns a mui column It will determine the type of column and add formatting to the mui column
Parameters:
Name Type Description
column LayoutColumn

View Source helpers/gridHelpers.js, line 326

MuiGridColumn

Type Definitions

Object

# LayoutColumn

Properties:
Name Type Attributes Description
path string The path to the data for the column
type number The type of the column
width string The width of the column
minWidth string <optional>
The value to display if the column is null
flex number <optional>
The flex value for the column
nullValue string <optional>
The value to display if the column is null
columnOverride function <optional>
A function that takes a layout column and returns a mui column

View Source helpers/gridHelpers.js, line 315