Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a Cancel Button along with the Back/Next Button so I can Exit the Process #91

Open
priyankabachu opened this issue Mar 21, 2018 · 6 comments
Labels
UpVotes Needed If you like this feature request, please upvote

Comments

@priyankabachu
Copy link

I want to call a function on cancel button of each step.
Can this be possible?

@newbreedofgeek
Copy link
Owner

@priyankabachu there is no Cancel button by default. Do you mean Back button?

Back: You can hook into the onStepChange callback, which should fire each time a step changes (back or next) and do any work you may need but this may not suit your need.

Next: The isValidated() method can prevent moving front until certain conditions are met. Step Validation

Pls provide more details on what you are trying to do..

@newbreedofgeek newbreedofgeek added Question Waiting for OP Waiting for Original Poster to respond labels Mar 25, 2018
@priyankabachu
Copy link
Author

@newbreedofgeek thanks for explaining much clearly :)
I don't want to navigate through the steps which i am able to do successfully by using back/Next buttons but in my requirement i need one more button cancel.
When the user clicks on the cancel button i want to Perform an action like Calling an Api .
So I wanted one more button under each step of wizard.

@newbreedofgeek newbreedofgeek added UpVotes Needed If you like this feature request, please upvote and removed Question Waiting for OP Waiting for Original Poster to respond labels Mar 25, 2018
@newbreedofgeek
Copy link
Owner

@priyankabachu OK, I see what you mean now. Unfortunately with StepZilla you are only given 2 buttons at the moment. This may change in the future but we have no plans to change this behaviour at this stage. I'll keep this ticket open as "UpVotes Needed" so people can upvote if they like this.

One way you can do this is to put a "Cancel" button in each and use CSS to position it in the "Footer" next to Back/Next - This is not ideal but it's how I would do it. Remember you control the full CSS of StepZilla so you can do anything with positioning.

Good luck.

@newbreedofgeek newbreedofgeek changed the title Can I have a cancel button on every step of wizard? Include a Cancel Button along with the Back/Next Button so I can Exit the Process. Mar 25, 2018
@newbreedofgeek newbreedofgeek changed the title Include a Cancel Button along with the Back/Next Button so I can Exit the Process. Include a Cancel Button along with the Back/Next Button so I can Exit the Process Mar 25, 2018
@priyankabachu
Copy link
Author

@newbreedofgeek ok Thankyou!
I will give a try !

@willk-hcss
Copy link

I'd like to see this as well, or maybe even a way of overriding/injecting custom buttons into the step navigation.

@keplerk
Copy link

keplerk commented Nov 25, 2019

The only way i found to do this, its inserting a button by myself on useEffect event

const parent = document.querySelector("div.multi-step div.footer-buttons");
const button = document.createElement("button");
button.classList.add(...["button", "is-danger", "pull-left"]);
button.innerHTML = "Cancelar";
button.id = "btnCancel";
parent.prepend(button);

It's a very dirty way to handle it, but i need a cancel button.

Edit: on onClick event you have to handle the redirection by yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UpVotes Needed If you like this feature request, please upvote
Projects
None yet
Development

No branches or pull requests

4 participants