How to Hide Finish button untill Last Tab #29

Closed
velanchandru opened this Issue Jul 17, 2013 · 2 comments

Comments

Projects
None yet
4 participants

Hi guys,

i want hide the Finish button while coming backwards.i want to show only if the user in the last step and sample code on how to use on showstep,
i know its possible to set this in onShowstep but if i did something in the onShowstep method Wizard not render properly it gets collapsed
i tried the following but no luck.

as StuartMorris said:

onShowStep:
function(){
var currentStep = $("#wizard").smartWizard("currentStep");
if(currentStep)
{
HideShowSubmit(currentStep);
}

function HideShowSubmit(step) {

            var LastTab = Tabs.length; //Total listitem length
            console.log('step: ' + step + ' LastTab: ' + LastTab);
            if (step == LastTab) {

                $('#wizard').smartWizard('setFinishButton', true);
                console.log('show');
            } else {
                $('#wizard').smartWizard('setFinishButton', false);
                console.log('hide');
            }

        }

sandip8600 commented Jun 29, 2016

call this function in show step callback
function fnDisableFinishButton(iCurrentStep, iFinishStep, oFinishButton) {
oFinishButton = oFinishButton || $(".actionBar .buttonFinish")
iFinishStep = iFinishStep || 3
if (oFinishButton && iCurrentStep == iFinishStep) {
oFinishButton.removeClass('buttonDisabled')
} else if (oFinishButton) {
oFinishButton.addClass('buttonDisabled')
}}`

@mstratman mstratman added the question label Jun 29, 2016

@mstratman mstratman closed this Jun 29, 2016

What values do I pass into this new function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment