surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.01k stars 782 forks source link

MC Matrix with checkbox column `showInMultipleColumns` visibleif #6826

Closed SamMousa closed 10 months ago

SamMousa commented 10 months ago

Are you requesting a feature, reporting a bug or asking a question?

Bug

What is the current behavior?

Columns are never re-rendered when using visibleIf for choices in a matrix multiple choice question with a checkbox column with showInMultipleColumns enabled.

What is the expected behavior?

If allowed as a configuration it should work.

How would you reproduce the current behavior (if this is a bug)?

Use the following JSON at surveyjs.io/create-free-survey

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "checkbox",
     "name": "question2",
     "choices": [
      "Item 1",
      "Item 2",
      "Item 3"
     ]
    },
    {
     "type": "matrixdropdown",
     "name": "question1",
     "columns": [
      {
       "name": "Column 1",
       "cellType": "checkbox",
       "showInMultipleColumns": true
      }
     ],
     "choices": [
      {
       "value": 1,
       "visibleIf": "{question2} contains 'Item 1'"
      },
      {
       "value": 2,
       "visibleIf": "{question2} contains 'Item 2'"
      },
      {
       "value": 3,
       "visibleIf": "{question2} contains 'Item 3'"
      },
      4,
      5
     ],
     "rows": [
      "Row 1",
      "Row 2"
     ]
    },
    {
     "type": "matrixdropdown",
     "name": "question4",
     "columns": [
      {
       "name": "Column 1",
       "cellType": "checkbox"
      }
     ],
     "choices": [
      {
       "value": 1,
       "visibleIf": "{question2} contains 'Item 1'"
      },
      {
       "value": 2,
       "visibleIf": "{question2} contains 'Item 2'"
      },
      {
       "value": 3,
       "visibleIf": "{question2} contains 'Item 3'"
      },
      4,
      5
     ],
     "rows": [
      "Row 1",
      "Row 2"
     ]
    }
   ]
  }
 ]
}
andrewtelnov commented 10 months ago

@SamMousa This issue has been fixed by this PR. We haven't had this functionality before.

Thank you, Andrew