Im wanting to provide my clients the ability to change the Add Panel Text. Ive added a property to the property grid but cant seem to target the panel question in the onPropertyChanged cycle. Any help would be appreciated. Here is my JSON.
CodequestionJSON: {
type: "paneldynamic",
name: "Multiple Profile Search",
title: "Multiple Profile Search",
titleLocation: "hidden",
templateElements: [
{
name: "profile_search",
type: "profile_search",
},
],
},
this doesnt work…
CodeonPropertyChanged: async (
question: Question & any,
propertyName: string,
newValue: any,
) => {
const survey = question.getSurvey();
survey?.getAllQuestions().forEach((q: any) => {
if (q.getType() === "paneldynamic") {
q.panels.forEach((panel: any) => {
panel.elements.forEach((element: any) => {
if (element.getType() === "panel") {
element.panelAddText = newValue;
}
});
});
}
});
if (propertyName == "Change Panel Add Text") {
if (question.getType() === custom_question_multiple_profile_search) {
const panel = survey.getPanelByName("Multiple Profile Search");
if (panel) {
panel.panelAddText = newValue;
}
}
}
//void
},