Wizard buttons - how to deal with them?

1 Answer 316 Views
Wizard
eleven
Top achievements
Rank 1
Iron
eleven asked on 12 Aug 2022, 09:55 PM

This question is two-fold, and I can't seem to find the answers in the documentation. For background info, I'm using the latest version of Wizard (the Tag version) :

  1. How do I hide the reset button? I don't need it for my form.
  2. How do I go about making the Wizard's 'Done' button a submit type of a button, so I can send the form contents to the server? (I can't seem to find how to go about this).

TIA!

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 17 Aug 2022, 04:27 PM

Hi Jenna,

Thank you for reaching out. Straight to your questions:

In regards to the visibility of the reset button:

By design, if the "reset" button is not explicitly added within the "<wizard-step-buttons>" tag, it will not be displayed. Thus, I would recommend omitting it. Here is an example:

// Additional Wizard configuration...
<wizard-step-buttons>
    <wizard-step-button text="Previous"
                        name="previous">
    </wizard-step-button>
    <wizard-step-button text="Done"
                        name="done">
    </wizard-step-button>
</wizard-step-buttons>

Would produce the following result:

In regards to the Wizard's done button:

At present, the TagHelper Wizard does not have a built-in configuration for rendering the wizard as a form element in comparison to the HTML Helper. Therefore, one way to achieve the desired result would be to:

  • Subscribe to the done event:
<kendo-wizard name="wizard"
              on-done="onDone">
  • Within the handler, get the respective model fields and make an ajax request to the server-side in order to process the data:
function onDone(e) {
         e.originalEvent.preventDefault();
        var model1 = e.forms[0]._model;
        var model2 = e.forms[1]._model;

        $.ajax({
            ...
        })
}

An alternative approach to this would be to use the HTML Helper initialization and configure it as a form element. From there, the "Done" button will automatically act as a submit button.

Please give this suggestion a try and let me know how it works out for you.

Kind Regards,
Alexander
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Wizard
Asked by
eleven
Top achievements
Rank 1
Iron
Answers by
Alexander
Telerik team
Share this question
or