twitter-bootstrap-wizard icon indicating copy to clipboard operation
twitter-bootstrap-wizard copied to clipboard

Show/hide demo broken

Open abbottmw opened this issue 7 years ago • 8 comments

On the demo where you can show/hide tabs or steps, after you hide a tab, the next and previous do not work correctly. It skips over steps.

http://vinceg.github.io/twitter-bootstrap-wizard/examples/remove-step.html#

abbottmw avatar Mar 11 '17 13:03 abbottmw

@abbottmw Yeah, i think because it does not call the refresh to reset the index count.

VinceG avatar Mar 15 '17 16:03 VinceG

The :visible fix I added should resolve this.

abbottmw avatar Mar 16 '17 02:03 abbottmw

The show/hide methods do not work even with the :visible fix added? Doing the following should show tab 3 and its tab panel - nothing happens?

$('#rootwizard').bootstrapWizard('display', 3);

Currently I'm having to revert to the standard bootstrap method:

  $('#rootwizard li:eq(2) a').tab('show') // Select third tab (0-indexed)

When can we expect a fix?

Adam-78 avatar Apr 03 '17 16:04 Adam-78

Many thanks. That worked like a charm.


From: Vincent Gabriel [email protected]

Try

$('#rootwizard').bootstrapWizard('show', 2);

Adam-78 avatar Apr 03 '17 17:04 Adam-78

Is it possible to call the show method from inside the onInit event. The following doesnt work:

 $('#rootwizard').bootstrapWizard({
       'onInit': function (tab, navigation, index) {
            var lastTabIndex = $("#LastTabIndex").val();
            if (lastTabIndex)
                  $('#rootwizard').bootstrapWizard('show', lastTabIndex);

        }
   });

Adam-78 avatar Apr 08 '17 16:04 Adam-78

@Adam-78 without the condition does $('#rootwizard').bootstrapWizard('show', x); work at all inside onInit?

VinceG avatar Apr 08 '17 18:04 VinceG

I get console error:

TypeError: this.data(...) is undefined

In the debugger it highlights the following line:

  return this.data('bootstrapWizard')[options](args);

I think it's because I'm trying to call the following from within $('#rootwizard').bootstrapWizard({...})

$('#rootwizard').bootstrapWizard('show', x);

Adam-78 avatar Apr 08 '17 20:04 Adam-78

@Adam-78 yeah it's impossible since onInit is called right after it's initialized.

i was able to make it work with the following

$('#rootwizard').bootstrapWizard({
        'onInit': function (tab, navigation, index) {
            setTimeout(function() {
              $('#rootwizard').bootstrapWizard('show', 2);
            }, 1);
        }
      });

VinceG avatar Apr 09 '17 00:04 VinceG