Giter VIP home page Giter VIP logo

Comments (20)

David-Melo avatar David-Melo commented on May 22, 2024 1

@digEmAll http://jsfiddle.net/157ttz1p/4/

Here you go, basically I wired every tabchange method to a validator function and pass in the current wizard tab. If the validation for that tab hasn't been met, then navigation is prevented. Hope this helps.

from twitter-bootstrap-wizard.

gayan-hewage avatar gayan-hewage commented on May 22, 2024 1

Wizard with disabled tab click not working?

http://vadimg.com/twitter-bootstrap-wizard-example/examples/basic-disabletabshow.html

any clue how to fix this?

from twitter-bootstrap-wizard.

VinceG avatar VinceG commented on May 22, 2024

@esheri3 I'll look into it and will let you know.

Thanks.

from twitter-bootstrap-wizard.

VinceG avatar VinceG commented on May 22, 2024

@esheri3 This is confirmed. i'll have to come up with a solution since the onTabShow is triggered when the tab is already shown. I think of updating the readme to state that onTabShow returning false will not prevent tab from showing and just fixing the onTabChange.

from twitter-bootstrap-wizard.

natiki avatar natiki commented on May 22, 2024

Playing with the latest ZIP as of writing it appears that the index parameter value in onTabChange() is always -1. Any chance we can get this bug fixed? Makes it very hard to use this component if you need to do validation before a user changes a tab.

Another idea would be to add an event OnTabChanging() which fires before the tab changes, that way none of the existing code has to change. Returning false there could prevent the change.

from twitter-bootstrap-wizard.

VinceG avatar VinceG commented on May 22, 2024

@natiki This is still WIP as the tab changing returning false does not prevent the fire of the method. So there needs to be a different solution. You can use the onNext even to do the same thing. and i am not sure what you meant with the last event addition

from twitter-bootstrap-wizard.

natiki avatar natiki commented on May 22, 2024

@VinceG Thanks for the feedback. What I meant was adding a new event called OnTabChanging which fires before the tab has changed as opposed to OnTabChanged which fires after the tab has changed.

If you add this to the life cycle then should a user want to prevent a tab being changed they return false there. Means you can leave the current behaviour (ie not have to do work out how to change back to the original tab when you are on the new tab already in OnTabShow etc.)

from twitter-bootstrap-wizard.

ruionwriting avatar ruionwriting commented on May 22, 2024

@VinceG what you think about pull request #69 ?

from twitter-bootstrap-wizard.

VinceG avatar VinceG commented on May 22, 2024

@ruionwriting Sorry, haven't tested this yet. i'll try to do it this weekend.

from twitter-bootstrap-wizard.

accomazzo avatar accomazzo commented on May 22, 2024

Are there any plans on fixing this? I would love to keep using this with my project, and I would love to help fix it as well, but it's beyond my abilities.

#69 doesn't seem to work for me either.

from twitter-bootstrap-wizard.

VinceG avatar VinceG commented on May 22, 2024

@accomazzo did you test #69 and it didn't work for you either?

from twitter-bootstrap-wizard.

accomazzo avatar accomazzo commented on May 22, 2024

Yes that's correct, I even tried using bootstrap 3.0, I am using 3.1.

from twitter-bootstrap-wizard.

rubyconvict avatar rubyconvict commented on May 22, 2024

'return false' does not work. On first tab get -1 index, then afrer clicking tab index gets cached, and on every first click on tab it has old index, on next clicks index is ok, but too late, so event if 'return false' would work, no glory.

Header navbar links are hard to disable, almost uncovered subject in the library.

from twitter-bootstrap-wizard.

David-Melo avatar David-Melo commented on May 22, 2024

Just in case anybody else runs into this like I did.

Using a combination of onTabClick and onNext I was able to prevent navigating based on validation

from twitter-bootstrap-wizard.

digEmAll avatar digEmAll commented on May 22, 2024

@David-Melo : could please create a jsfiddle example ?
You can modify this if you like: http://jsfiddle.net/157ttz1p/2/

from twitter-bootstrap-wizard.

digEmAll avatar digEmAll commented on May 22, 2024

@David-Melo thanks a lot :)

from twitter-bootstrap-wizard.

siliconalchemy avatar siliconalchemy commented on May 22, 2024

Using the latest code, returning false for onTabClick doesn't work:
onTabClick: function(tab, navigation, index) {
return false;
}
It doesn't seem possible to disable tab clicks, which is a problem.

from twitter-bootstrap-wizard.

4pr3x avatar 4pr3x commented on May 22, 2024

onTabClick: function(tab, navigation, index) {
return false;
}
Is working for me!
Only issue I have with onTabClick function is, that my "prev" & "next" button´s CSS is for some reason changed.

from twitter-bootstrap-wizard.

VinceG avatar VinceG commented on May 22, 2024

@gayanc can you try this:

http://vinceg.github.io/twitter-bootstrap-wizard/examples/basic-disabletabclick.html

from twitter-bootstrap-wizard.

keremcankaya0 avatar keremcankaya0 commented on May 22, 2024

After an hour of struggle removing data-toggle=tab from the nav actually worked

from twitter-bootstrap-wizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.