jQuery-Smart-Wizard icon indicating copy to clipboard operation
jQuery-Smart-Wizard copied to clipboard

goToStep is not working

Open harisr92 opened this issue 7 years ago • 5 comments

$('#wizard').smartWizard("goToStep", 5) I am running this code on document on load function but its not going to step 5. Please need help Thank you

harisr92 avatar Feb 13 '18 11:02 harisr92

Hi in latest version the public method was removed, add this : goToStep: function (stepNum) { this._showStep(stepNum); }, in SmartWizard/dist/js/jquery.smartWizard.js

cmanuelf87 avatar May 11 '18 20:05 cmanuelf87

@cmanuelf87 goToStep: function (stepNum) { this._showStep(stepNum); }, is not working.

RajeshMalviya14 avatar Jul 12 '18 07:07 RajeshMalviya14

Hi @RajeshMalviya14 if you want you can put the file where you placed the function to review what may be missing

cmanuelf87 avatar Jul 12 '18 12:07 cmanuelf87

Hi,

Thanks for this great work.

Why did you delete the public methods and leave it in the doc ?

To make it works, add the previous method on line 86 in SmartWizard/dist/js/jquery.smartWizard.js, before "init" : `$.extend(SmartWizard.prototype, {

    goToStep: function (stepNum) {
        this._showStep(stepNum);
    },
    
    init: function () {
        // Set the elements
        this._setElements();
        // Add toolbar
        this._setToolbar();
        // Assign plugin events
        this._setEvents();`

$('#smartwizard').smartWizard('goToStep', nextStep);

AdrienV avatar Aug 05 '18 18:08 AdrienV

@AdrienV i think the reason behind removing it would be that it does not respect the options if selected not to navigate away from the step using enableAllSteps:false it would still allow the user to move to the next steps by just calling the method in console, maybe maybe not. just a wild guess.

buttflattery avatar Mar 26 '19 17:03 buttflattery