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
this.survey.currentPageNo = this.survey.pages[5];as per currentPage docs?