[Ticket cloned from T3320: How to customize a widget]
Hello!!
What is the function event for adding page on surveyjs?
On 1/27/2020 12:27 PM, Support Support wrote:
[Ticket cloned from T3320: How to customize a widget]
Hello!!
What is the function event for adding page on surveyjs?
On 1/27/2020 12:27 PM, Support Support wrote:
Hello,
You should use the https://surveyjs.io/Documentation/Survey-Creator/?id=surveycreator#onPageAdded event as shown in this live sample - https://plnkr.co/edit/tjcXxlbtJpdvO2uI3d3M?p=preview
Thanks, Serge
SurveyJS Team
Hello,
Could you please describe your business case in greater details? It's hard to suggest something without any context.
Thanks, Serge
SurveyJS Team
I am trying to get the json object if the user click on add new page. How do I get the previous page with the json object
On 2/5/2020 10:54 AM, Support Support wrote:
Hello,
I am afraid that you need the previous json for something bigger and this is just a step that you believe need to implement something. However, this step maybe not needed at all. What is the final goal?
Thank you,
Andrew
SurveyJS Team
Hello,
survey.onPageAdded event.
Thank you,
Andrew
SurveyJS Team
still not working
On 2/6/2020 2:48 PM, Support Support wrote:
JavaScript
this.surveyCreator.onPageAdded.add(function(sender, options) {
alert(JSON.stringify(this.surveyCreator.survey.pages[0].toJSON()));
});
Code
this is error an occur, Cannot read property 'survey' of undefined
On 2/6/2020 2:48 PM, Support Support wrote:
JavaScript
this.surveyCreator.onPageAdded.add(function(sender, options) {
alert(JSON.stringify(this.surveyCreator.survey.pages[0].toJSON()));
});
Code
Hello,
You've got the wrong this
context. You can use the fat arrow notation here:
JavaScriptthis.surveyCreator.onPageAdded.add((sender, options) => {
alert(JSON.stringify(this.surveyCreator.survey.pages[0].toJSON()));
});
If you are a licensed user of SurveyJS Creator please write us from the e-mail linked to your license so we can recognize you as a licensed customer. Thank you for your understanding.
Thanks, Serge
SurveyJS Team