Skip to content
This repository has been archived by the owner on Aug 6, 2019. It is now read-only.

Show/hide demo broken #209

Open
abbottmw opened this issue Mar 11, 2017 · 8 comments
Open

Show/hide demo broken #209

abbottmw opened this issue Mar 11, 2017 · 8 comments

Comments

@abbottmw
Copy link

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#

@VinceG
Copy link
Owner

VinceG commented Mar 15, 2017

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

@abbottmw
Copy link
Author

The :visible fix I added should resolve this.

@Adam-78
Copy link

Adam-78 commented Apr 3, 2017

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
Copy link

Adam-78 commented Apr 3, 2017 via email

@Adam-78
Copy link

Adam-78 commented Apr 8, 2017

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

        }
   });

@VinceG
Copy link
Owner

VinceG commented Apr 8, 2017

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

@Adam-78
Copy link

Adam-78 commented Apr 8, 2017

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

@VinceG
Copy link
Owner

VinceG commented Apr 9, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants