0

I'm using the library SurveyJS in my angular project. I need to be able to navigate through pages programmatically. My first attempt was:

this.survey.currentPageNo = 5;  //navigate to page 5.

Unfortunately it didn't work. So I checked the documentation about this field and it states that:

A zero-based index of the current page in the visiblePages array.

So, I'm only allowed to navigate throught visible pages. My survey has 10 pages, so this.survey.pages.length = 10, but this.survey.visiblePages.length = 1, it means that only the first page is visible. According to the documentation, I should be able to set the page visibility by adding a "visible" : true to the page configuration. So in my case it would be something like:

"pages": [
    {
        "elements": [
            //list of elements
        ],
        "visible": true,
        "name": "page1"
    },

    {
        "elements": [
            //list of elements
        ],
        "visible": true,
        "name": "page2"
    }
]

but visiblePages.length is still 1... What am I missing? Thanks in advance

2
  • please share a stackblitz or more code with the basic issue reproducible! Commented Dec 27, 2023 at 15:52
  • Have you tried this.survey.currentPageNo = this.survey.pages[5]; as per currentPage docs? Commented Dec 27, 2023 at 15:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.