Question T1779
Visible to All Users

Add columns and row dynamically from setting for matrix

created 6 years ago

I have created a custom property called as "Number of column", on select of that i want to dynamically add columns. I have used onPropertyValueChanging. But i'm getting error while pushing a new column.

Here is plunker link : https://plnkr.co/edit/M3uyMAQQsR4iJB5JR3X7?p=preview

Answers approved by surveyjs Support

created 6 years ago

Hello,
For matrix dynamic, you should use public addColumn(name: string, title: string = null): MatrixDropdownColumn function:

JavaScript
matrixdynamic.addColumn("myColumnName", "my Column Title");

Thank you,
Andrew
SurveyJS Team

    Show previous comments (9)

      For selectbase i'm getting it as undefined.

      Plunker link : https://plnkr.co/edit/jwythZf5qlFcRWbgV6UE?p=preview

        Here is the updated plunker

        JavaScript
        Survey.JsonObject.metaData.findProperty("matrixdropdowncolumn", "cellType").visible = false; Survey.JsonObject.metaData.findProperty("matrixdropdowncolumn", "isRequired").visible = false;

        Thank you,
        Andrew
        SurveyJS Team

          Thanks a lot :)