Jquery Steps ->button click->go to step

2019-08-13 09:48发布

I'm using the jquery steps wizard in asp.net application. I have problem with event to change step when click the button. Initailize steps in file.js

var WizardFunc = function () {
    var wizard = null;
    return {
        WizardSet: function () {
            wizard = $('#order').steps({
                bodyTag: "fieldset",
                transitionEffect: "slideLeft",
                headerTag: "h1",
                autoFocus: true
            });
        },
        WizardStepAdd: function (index, title, contentId) {
            wizard.steps("insert", index, {
                title: title,
                content: "<div id='" + contentId + "'></div>"
            });
        },
        WizardGoToStep: function (index) {
            wizard.steps("setStep", 1);
        },
        WizardStepRemove: function (index) {
            wizard.remove(index);
        }
    }
}();

I try call to function:

$("#new-size-container").on("click", ".add-size", function () { 
WizardFunc.WizardGoToStep(1);}

return error:

Not yet implemented!

Q: How call function to change step index when button click ?

2条回答
迷人小祖宗
2楼-- · 2019-08-13 10:09

For any person who are coming to this old unresolved post, please note that this plugin is able to navigate dynamically to step (next or previous) as described here : http://www.rafaelstaib.com/category/jQuery-Steps

$(this).steps("previous");

or

$(this).steps("next");

查看更多
放荡不羁爱自由
3楼-- · 2019-08-13 10:13

I think this plugin does not support the features you are currently using. Here is the code from plugin

/**
 * Sets a specific step object by index.
 *
 * @method setStep
 * @param index {Integer} An integer that belongs to the position of a step
 * @param step {Object} The step object to change
 **/
$.fn.steps.setStep = function (index, step)
{
    throw new Error("Not yet implemented!");
};

/**
 * Skips an certain amount of steps.
 *
 * @method skip
 * @param count {Integer} The amount of steps that should be skipped
 * @return {Boolean} Indicates whether the action executed
 **/
$.fn.steps.skip = function (count)
{
    throw new Error("Not yet implemented!");
};
查看更多
登录 后发表回答