jquery-steps icon indicating copy to clipboard operation
jquery-steps copied to clipboard

Get Total number of steps

Open bpbhat77 opened this issue 10 years ago • 2 comments

How get Total number of steps i.e total count in current wizard ?? any method ??

bpbhat77 avatar Mar 11 '14 12:03 bpbhat77

I just started using this plugin and I really like it . I created this method to get the steps. Working for me so far...

function getTotalSteps(wizard)
{
    var steps = getSteps(wizard);
    var count = 1;
    for (var i = 0 ; i <= steps.length; i++)
    {
        count = count + 1;
    }
    return count;
}

r4hulgupta avatar Aug 15 '17 01:08 r4hulgupta

After these lines in jquery.steps.js

$.fn.steps.skip = function (count)
{
    throw new Error("Not yet implemented!");
};

Insert this snippet


/**
 * Get number of steps in wizard
 *
 * @method getTotalSteps
 * @return {Integer} Total Steps in Wizard
 **/
$.fn.steps.getTotalSteps = function () {
    var wizard = this;
    var steps = getSteps(wizard);
    return steps.length;
};

Usage: wizard.steps('getTotalSteps')

amard33p avatar Aug 22 '19 10:08 amard33p