In reading the BootStrap documentation related to the nav-tabs, I do not see any way to simply count the number of nav-items in a nav-tabs class.
I have searched StackOverflow and the internet without success. Surely there is a way to return a count of # of defined nav-items using jquery.
The requirement is our users want Previous and Next buttons below the "tabbed" view of the data. They "could" click on each individual tab header to display the contents of the tab, but would rather click a button (i.e. Next Tab or Previous Tab). I was hoping to implement a generic function since there are a large number of windows in which to apply this design. Next, depending on which Button is clicked (previous or next), I could do something like this:
Pseudo-code
if ((buttonClicked == 'Previous') && ((currentTab - 1) != 0) {
tabPane.currentTab -= 1;
} else if ((buttonClicked == 'Previous') && ((currentTab - 1) == 0) {
previousButton.disable();
} else if ((buttonClicked == 'Next') && ((currentTab + 1) <= maxTabs) {
tabPane.currentTab += 1;
} else if ((buttonClicked == 'Next') && ((currentTab + 1) == maxTabs) {
nextButton.disable();
}
Hopefully, there is an easy answer to my minor dilemma.