Basic Usage
Parameters
Unique identifier for the question.
The main question text.
Additional text to provide context or instructions.
An array of strings representing the row labels.
An array of strings representing the column labels (options for each row).
Whether the question is required.
Whether to randomize the order of rows.
Whether to randomize the order of columns.
A custom validation function that takes the response as input and returns true if valid, or an error message string if invalid.
Custom styles to apply to the question. Available keys are:
rootinnerContainertextContainertextsubTexttableheaderRowheaderCellrowWrapperrowrowLabelcellradioerrorMessage
Data
Response Format The Grid question type returns an object where keys are row labels and values are the selected column labels:- All rows have a selected option when required is set to true.
- Any custom validation provided in the
customValidationfunction passes.
Advanced
Methods
The Grid question type inherits methods from the base Element class and includes some specific methods:Set the response for the question.Parameters:
value(object): An object where keys are row labels and values are selected column labels
Validate the current response against the question’s rules.Returns:
- An object with
isValid(boolean) anderrorMessage(string) properties.
Update the response based on the current state of the radio buttons.This method is typically called internally when the user interacts with the question.

