Question T11700
Visible to All Users

PopUp description in translation tab

created 2 years ago (modified 2 years ago)

Hello,
Is it possible for the popupdescription field I added to appear in the translation tab, because by default the field does not appear.

It adds a popupdescription property as follows:

JavaScript
Serializer.addProperty("question", { name: "popupdescription:text", category: "general", visibleIndex: 1 });
JavaScript
function createButtonForPopup(options, showPopup) { // Add a button; let btn = document.createElement("button"); // Show button if popupDescription property is not empty btn.style.visibility = !options.question.popupdescription ? "hidden" : ""; btn.type = "button"; btn.className = "sd-btn sd-btn--action"; btn.style.position = "relative"; btn.style.marginLeft = "20px"; btn.style.padding = "0 8px"; btn.style.border = "none"; btn.innerHTML = "More Info"; // Change button visibility on changing the property options.question.registerPropertyChangedHandlers(["popupdescription"], function (newValue) { btn.style.visibility = !newValue ? "hidden" : ""; }); if (showPopup) { let textPopup = options.question.popupdescription; btn.onclick = function(){ alert(textPopup) } } let header = options.htmlElement.querySelector("h5"); let span = document.createElement("span"); span.innerHTML = " "; if(header!=null)header.appendChild(span); if(header!=null)header.appendChild(btn); }

Regards
Mateusz

Answers

created 2 years ago

The problem has been resolved ;)

JavaScript
Serializer.addProperty("question", { name: "popupdescription:text", category: "general", visibleIndex: 1, isLocalizable: true });

I leave it for others ;)

Regards
Mateusz

    Comments (1)

      Hello Mateusz,
      Thank you for the update. We're happy to hear that you've found the solution.

      For more information on how to create custom properties, refer to Add Custom Properties to the Property Grid. More details about the islocalizable property is available at
      https://surveyjs.io/survey-creator/documentation/property-grid#islocalizable.

      Should you have any questions or require further assistance, let us know.