Matrix Question with Custom Cell Types
Multi-Select and Dynamic Matrix question types provide built-in support for a number of cell editors, such as drop-down menus, radio button groups, text input fields, etc. If the built-in functionality doesn't suit your use case, you can extend the collection of available cell editors by implementing a custom editor or by using other editors from SurveyJS Form Library, as demonstrated in this example.
By default, Multi-Select Matrix and Dynamic Matrix columns support the cell editors listed in the cellType
property description. These cell editors are based upon standalone question types from SurveyJS Form Library. However, the library also includes other question types. To use them as matrix cell editors, add a property named as the question type to the matrixDropdownColumnTypes
object and assign an empty object to this property. This demo and the following code shows how to add the File Upload question type to the list of supported cell editors:
import { matrixDropdownColumnTypes } from "survey-core";
matrixDropdownColumnTypes["file"] = {};
Now, users can select File Upload from the Cell input type drop-down menu when they click a matrix column. File Upload properties also become available for configuration in the Property Grid.