surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
915 stars 373 forks source link

Custom Question Type - How to register custom properties of an expression type #5386

Closed JaneSjs closed 6 months ago

JaneSjs commented 7 months ago

T17578 - Custom Component not getting dynamic value on property https://surveyjs.answerdesk.io/internal/ticket/details/T17578

andrewtelnov commented 7 months ago

@RomanTsukanov @JaneSjs It should be the following code added into constructor: this.addExpressionProperty("productIdExpression", (obj: Base, res: any) => { this.productId = res; });

Thank you, Andrew

JaneSjs commented 7 months ago

@RomanTsukanov, please let me know what you think. I updated the Descriptive element demo and added a captionExpression property. It allows users to define an expression for the Caption property. View CodeSandbox

Now, the component has the following options:

JaneSjs commented 6 months ago

@RomanTsukanov suggested another option to update the documentation.