Jquery Steps ->button click->go to step

删除回忆录丶 提交于 2019-12-11 08:38:23

问题


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 ?


回答1:


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!");
};



回答2:


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");


来源:https://stackoverflow.com/questions/20721628/jquery-steps-button-click-go-to-step

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!