QuestionMatrixDropdownModel

A class that describes the Multi-Select Matrix question type. Multi-Select Matrix allows you to use the Dropdown, Checkbox, Radiogroup, Text, and Comment question types as cell editors.

View Demo

Inherited from the following class(es):

alternateRows property

Specifies whether to apply shading to alternate matrix rows.

Single-Select Matrix Demo

Type:
boolean readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase

Specifies the error message position relative to matrix cells.

Possible values:

  • "default" (default) - Inherits the setting from the errorLocation property.
  • "top" - Displays error messages above matrix cells.
  • "bottom" - Displays error messages below matrix cells.
Type:
string readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
default
Accepted values:
default , top , bottom
Implemented in:
QuestionMatrixDropdownModelBase
See also:
detailErrorLocation
cellType property

Specifies the type of matrix cells. You can override this property for individual columns.

Possible values:

Default value: "dropdown" (inherited from settings.matrix.defaultCellType)

Multi-Select Matrix Demo

Dynamic Matrix Demo

Type:
string readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
dropdown
Accepted values:
dropdown , checkbox , radiogroup , tagbox , text , comment , boolean , expression , rating , slider
Implemented in:
QuestionMatrixDropdownModelBase
choices property

Gets or sets choice items for Dropdown, Checkbox, and Radiogroup matrix cells. You can override this property for individual columns.

This property accepts an array of objects with the following structure:

{
  "value": any, // A value to be saved in survey results
  "text": string, // A display text. This property supports Markdown. When `text` is undefined, `value` is used.
  "customProperty": any // Any property that you find useful.
}

To enable Markdown support for the text property, implement Markdown-to-HTML conversion in the onTextMarkdown event handler. For an example, refer to the following demo: Convert Markdown to HTML with markdown-it.

If you add custom properties, refer to the following help topic to learn how to serialize them into JSON: Add Custom Properties to Property Grid.

If you need to specify only the value property, you can set the choices property to an array of primitive values, for example, [ "item1", "item2", "item3" ]. These values are both saved in survey results and used as display text.

Type:
any[] writable

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
[]
Implemented in:
QuestionMatrixDropdownModelBase
See also:
cellType
columnColCount property

Specifies the number of columns in Radiogroup and Checkbox cells.

Default value: 0 (the number of columns is selected automatically based on the available column width)

Type:
number readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Accepted values:
0 , 1 , 2 , 3 , 4
Implemented in:
QuestionMatrixDropdownModelBase
See also:
cellType
columnMinWidth property

Minimum column width in CSS values.

Multi-Select Matrix Demo

Dynamic Matrix Demo

Type:
string readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase
See also:
width
columns property

An array of matrix columns.

For a Single-Select Matrix, the columns array can contain configuration objects with the text (display value) and value (value to be saved in survey results) properties. Alternatively, the array can contain primitive values that will be used as both the display values and values to be saved in survey results.

Single-Select Matrix Demo

For a Multi-Select Matrix or Dynamic Matrix, the columns array should contain configuration objects with properties described in the MatrixDropdownColumn API Reference section.

Multi-Select Matrix Demo

Type:
any[] readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase
columnsVisibleIf property

A Boolean expression that is evaluated against each matrix column. If the expression evaluates to false, the column becomes hidden.

A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.

Use the {item} placeholder to reference the current column in the expression.

Refer to the following help topic for more information: Conditional Visibility.

View Demo

Type:
string readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase
See also:
rowsVisibleIf
detailElements property

An array of survey elements (questions and panels) to be displayed in detail sections.

Detail sections are expandable panels displayed under each matrix row. You can use them to display questions that do not fit into the row.

Set the detailPanelMode property to "underRow" or "underRowSingle" to display detail sections.

View Demo

Type:
IElement[] readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase
See also:
detailPanel

Specifies the error message position for questions within detail sections.

Possible values:

  • "default" (default) - Inherits the setting from the errorLocation property.
  • "top" - Displays error messages above questions.
  • "bottom" - Displays error messages below questions.
Type:
string readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
default
Accepted values:
default , top , bottom
Implemented in:
QuestionMatrixDropdownModelBase
See also:
cellErrorLocation
detailPanel property

Contains a PanelModel instance that represents a detail section template.

Type:
PanelModel readonly
Implemented in:
QuestionMatrixDropdownModelBase
See also:
detailElements * , detailPanelMode
detailPanelMode property

Specifies the location of detail sections.

Possible values:

  • "underRow" - Displays detail sections under their respective rows. Users can expand any number of detail sections.
  • "underRowSingle" - Displays detail sections under their respective rows, but only one detail section can be expanded at a time.
  • "none" (default) - Hides detail sections.

Use the detailElements property to specify content of detail sections.

View Demo

Type:
string readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
none
Accepted values:
none , underRow , underRowSingle
Implemented in:
QuestionMatrixDropdownModelBase
See also:
detailPanel
displayMode property

Specifies how to arrange matrix questions.

Possible values:

  • "table" - Displays matrix questions in a table.
  • "list" - Displays matrix questions one under another as a list.
  • "auto" (default) - Uses the "table" mode if the survey has sufficient width to fit the table or the "list" mode otherwise.
Type:
"auto" | "table" | "list" readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
auto
Accepted values:
auto , table , list
Implemented in:
QuestionMatrixDropdownModelBase

Returns a matrix column with a given name or null if a column with this is not found.

Type:
(columnName: string) => MatrixDropdownColumn
Parameters:
columnName, type: string ,

A column name.

Implemented in:
QuestionMatrixDropdownModelBase
getRowValue method

Returns an object with row values. If a row has no answers, this method returns an empty object.

Type:
(rowIndex: number) => any
Parameters:
rowIndex, type: number ,

A zero-based row index.

Implemented in:
QuestionMatrixDropdownModelBase
See also:
setRowValue
hideIfRowsEmpty property

Specifies whether to hide the question when the matrix has no visible rows.

Type:
boolean readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModel
See also:
rowsVisibleIf

Returns true if columns are placed in the horizontal direction and rows in the vertical direction.

To specify the layout, use the transposeData property. If you set it to true, the survey applies it only when the screen has enough space. Otherwise, the survey falls back to the original layout, but the transposeData property remains set to true. Unlike transposeData, the isColumnLayoutHorizontal property always indicates the current layout.

Type:
boolean readonly
Implemented in:
QuestionMatrixDropdownModelBase
See also:
transposeData

An error message displayed when users enter a duplicate value into a column that accepts only unique values (isUnique is set to true or keyName is specified).

A default value for this property is taken from a localization dictionary. Refer to the following help topic for more information: Localization & Globalization.

Type:
string writable

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase
See also:
useCaseSensitiveComparison
placeholder property

A placeholder for Dropdown matrix cells.

Type:
string writable

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase
See also:
cellType
rowOrder property

Specifies a sort order for matrix rows.

Possible values:

  • "initial" (default) - Preserves the original order of the rows array.
  • "random" - Arranges matrix rows in random order each time the question is displayed.
Type:
string readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
initial
Accepted values:
initial , random
Implemented in:
QuestionMatrixDropdownModel
Available since:
 v2.0.0
See also:
rows *
rowTitleWidth property

A width for the column that displays row titles (first column). Accepts CSS values.

Type:
string readonly
Implemented in:
QuestionMatrixDropdownModelBase
rows property

An array of matrix rows.

This array can contain primitive values or objects with the text (display value) and value (value to be saved in survey results) properties.

Single-Select Matrix Demo

Multi-Select Matrix Demo

Type:
any[] readonly
Implemented in:
QuestionMatrixDropdownModelBase
rowsVisibleIf property

A Boolean expression that is evaluated against each matrix row. If the expression evaluates to false, the row becomes hidden.

A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.

Use the {item} placeholder to reference the current row in the expression.

Refer to the following help topic for more information: Conditional Visibility.

View Demo

Type:
string readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase
See also:
visibleRows * , columnsVisibleIf
setRowValue method

Assigns values to a row.

Type:
(rowIndex: number, rowValue: any) => any
Parameters:
rowIndex, type: number ,

A zero-based row index.

rowValue, type: any ,

An object with the following structure: { "column_name": columnValue, ... }

Implemented in:
QuestionMatrixDropdownModelBase
See also:
getRowValue
showHeader property

Specifies whether to display the table header that contains column captions.

Default value: true

Type:
boolean readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
True
Implemented in:
QuestionMatrixDropdownModelBase

A title template that applies when the survey is in input-per-page mode.

Default value: "Row {rowIndex}" for Dynamic Matrix | "{rowTitle}" for Multi-Select Matrix

The template can contain the following placeholders:

  • {rowIndex} - A row index within the collection of all rows. Starts with 1.
  • {visibleRowIndex} - A row index within the collection of visible rows. Starts with 1.
  • {rowName} - A row name (the value property within objects in the rows array). Use this placeholder if you need to distinguish between matrix rows.
  • {rowTitle} - A row title (the text property within objects in the rows array).
  • {row.columnname} - The value of a cell in the same row.

View Demo

Type:
string writable

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase
Available since:
 v2.0.6
totalText property

A title for the total row. Applies if at least one column displays total values.

Type:
string writable

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModel
See also:
rowTitleWidth * , columns
transposeData property

Specifies whether to display columns as rows and rows as columns.

Default value: false

Multi-Select Matrix Demo

Dynamic Matrix Demo

Type:
boolean readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Implemented in:
QuestionMatrixDropdownModelBase

Enables case-sensitive comparison in columns with the isUnique property set to true.

When this property is true, "ABC" and "abc" are considered different values.

Default value: false

Type:
boolean writable
Implemented in:
QuestionMatrixDropdownModelBase
Available since:
 v2.0.0
See also:
keyDuplicationError *
verticalAlign property

Aligns matrix cell content in the vertical direction.

Type:
"top" | "middle" readonly

This property is stored in the survey JSON definition and can be edited in the Survey Creator.

Default value:
middle
Accepted values:
top , middle
Implemented in:
QuestionMatrixDropdownModelBase
visibleRows property

Returns an array of visible matrix rows.

Type:
MatrixDropdownRowModelBase[] readonly
Implemented in:
QuestionMatrixDropdownModelBase
See also:
rowsVisibleIf

Send feedback to the SurveyJS team

Need help? Visit our support page

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.