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

Dynamically enable or disable the pagination

Open efusionsoft opened this issue 9 years ago • 3 comments

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

efusionsoft avatar Jan 23 '16 04:01 efusionsoft

i'm searching for that too :/

NicoxDJ avatar Dec 13 '18 09:12 NicoxDJ

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

tolgatasci avatar Oct 18 '22 10:10 tolgatasci

        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.

abdulhaseeb036 avatar Dec 01 '22 13:12 abdulhaseeb036