Hello!
Is it possible to enable/disable element in Dropdown based on item properties?
JavaScriptvar json = {
questions: [
{
type: "dropdown",
name: "car",
title: "What car are you driving?",
isRequired: true,
colCount: 0,
choices: [
{ title: "One", value: "91", isDeleted: true },
{ title: "Two", value: "91", isDeleted: false },
{ title: "Three", value: "91", isDeleted: false }
],
/** What is the expression should I use here? */
choicesVisibleIf: "{item}.isDeleted == false"
}
]};
Here is a playground: https://plnkr.co/edit/LIp8pZbyXVB3UfBD
Thanks.
Thanks, Serge for your answer.
Is it possible to assign custom properties like this?
question.choices = myDictionary.map(x => ({ value: x.Id, text: x.Name, isDeleted: x.IsDeleted }));
Looks like isDeleted just ignored.
Hello,
In this case you need to set custom properties separately.
Thanks, Serge
SurveyJS Team