Closed MinWook6457 closed 1 month ago
Hello @MinWook6457,
From what I gather, you wish to register a custom navigation action. The custom button should be available on all survey pages except the last page. To hide a button from the last page, use a ComputedUpdater
to update the action's visible attribute depending on the current survey page number. Consider the following demo: View Plunker.
import { ComputedUpdater } from "survey-core";
const clearPageButton = {
id: "sv-nav-clear-page",
title: "Clear Page",
action: () => {
survey.currentPage.questions.forEach((question) => {
question.value = undefined;
});
},
visible: new ComputedUpdater(() => {
return survey.currentPageNo != survey.pages.length - 1;
}),
css: "nav-button",
innerCss: "sd-btn nav-input"
}
Let me know if this code works for you.
Hi, 'JaneSjs'. First of all, thanks for your help.
After applying your code, it worked out the way I wanted.
I was able to solve this problem with the code below.
visible: new ComputedUpdater(() => {
return survey.currentPageNo != survey.pages.length - 1;
}),
Thank you for your help,
Are you requesting a feature, reporting a bug or ask a question?
Hi, there. I want to make button all pages using custom.
This is my code. _surveyModel: new Survey.Model($("#rsrchModelJson").val())
When survey init, This survey made by rsrchModelJson. So, my action making button has all button to all pages. I want that last page does not make Button.
How to make logic or what to use method?