Question T6373
Visible to All Users

How to add new properties into matrix dropdown/dynamic column?

created 4 years ago (modified 4 years ago)

[Ticket cloned from T660: Modifications to Matrix (Multiple Choices) component]

Hello Andrew Telnov
Just checked this ticket that was posted 3 years ago, now I am trying to do something similar

I tried with the code you posted but it didn’t work
I need to add a new item type checkbox photo required? and another type number How many photos? in the columns
Captura de Pantalla 2021-02-17 a la(s) 12.19.03 p. m..png

Thanks for your help!
Suceli

Answers approved by surveyjs Support

created 4 years ago

Hello,
Please use the following code:

JavaScript
Survey.Serializer.addProperty("matrixdropdowncolumn", {name"photoRequired:boolean"displayName"Photo Required?" }); Survey.Serializer.addProperty("matrixdropdowncolumn", {name"howManyPhotos:number"displayName"How Many Photos?"}); SurveyCreator.SurveyQuestionEditorDefinition.definition.matrixdropdowncolumn.properties = ["isRequired""photoRequired""howManyPhotos""cellType""name""title"];

Here is the working example.

Thank you,
Andrew
SurveyJS Team

    Other Answers

    created 4 years ago

    Thanks!
    I found the solution here

    JavaScript
    //Add new property into the column Survey.Serializer.addProperty('matrixdropdowncolumn', { name: 'foto:boolean' }); SurveyCreator.SurveyQuestionEditorDefinition.definition["matrixdropdowncolumn"].properties.push("foto"); SurveyCreator.defaultStrings.pe.tag = "Foto obligatoria"; Survey.Serializer.addProperty('matrixdropdowncolumn', { name: 'cantidad:number' }); //Add it into editing table SurveyCreator.SurveyQuestionEditorDefinition.definition["matrixdropdowncolumn"].properties.push("cantidad"); //Change property title for default localization SurveyCreator.defaultStrings.pe.tag = "Cantidad de fotos";

    https://surveyjs.answerdesk.io/ticket/details/t3554

      Comments (1)

        Great!

        Andrew
        SurveyJS Team