question
I have defined a customer question type named cascadedropdown, the code is as follows :
ComponentCollection.Instance.add({
// A unique name; must use lowercase
name: 'casecadedropdown', // A display name used in the Toolbox
title: 'casecade dropdown', // A default title for questions created with this question type
defaultQuestionTitle: 'choose an option',
elementsJSON: [{
type: 'dropdown',
name: 'question1',
title: 'question1',
choices: levelOneArray,
},{
type: 'dropdown',
name: 'question2',
title: 'question2',
startWithNewLine: false,
choices:[],
},{
type: 'dropdown',
name: 'question3',
title: 'question3',
startWithNewLine: false,
choices:[],
visible: {questionListLen} > 2
},{
type: 'dropdown',
name: 'question4',
title: 'question4',
startWithNewLine: false,
choices:[],
visible: {questionListLen} > 3
}
],
calculatedValues:[{
name:"questionListLen",
expression: casecadeQuestionList.length
} ],
inheritBaseProps: true,
}]
after the cascadedropdown
loading, the casecadeQuestionList will be assigned by another value, whether the question3 and question4 display or not depends on the casecadeQuestionList.length, how can I watch the casecadeQuestionList.length change?
trying
I defined the calculated value above, but it does not work. What should I do?