jquery-steps
jquery-steps copied to clipboard
Dynamically enable or disable the pagination
When initializing the plugin I set
enablePagination:false,
Now when the first step is submitted I would like the the pagination to show in the subsequent steps, is it possible? I tried the following without any luck:
var settings = {enablePagination: true};
$("#wizard_form").steps("next", settings);
i'm searching for that too :/
public.js
$.fn.steps.disable = function (indexs)
{
for (var i = 0; i < indexs.length; i++)
{
disable_click(this, getOptions(this), getState(this), indexs[i]);
}
};
privates.js
function disable_click(wizard, options, state, index)
{
if (index < 0 || index > state.stepCount)
{
throwError(_indexOutOfRangeErrorMessage);
}
var anchor = getStepAnchor(wizard, index),
parent = anchor.parent(),
isDisabled = parent.hasClass("disabled"),
is_current = parent.hasClass("current");
if(!isDisabled && !is_current){
parent.addClass('disabled');
}
return wizard;
}
grunt build
USE
$("#wizard").steps("disable", [1,2,3]);
form.steps("insert", 3, {
title: "step 4",
content: "<p>Step Body</p>"
});
After this, next 2 step title number will be same, I want to update it also. like step added after some condition then step 4 title become step 5.