Using Unique and Toggle in a TreeView jQuery Hierarchical Navigation System
Naturally, if you've been a patient reader and already went through the previous chapter of the series, then it's quite possible that you're pretty familiar with the basic capabilities offered by the "TreeView" library. In that particular tutorial I explained how to work with its "animate" option, which can be used for applying a couple of appealing scrolling effects to the branches of a selected tree while they're being closed and extended.
Of course, when it comes to exploring the numerous capacities offered by the "TreeView" plug-in, I must say that there's still a fair bit to learn. It comes packaged with another handy feature that deserve a closer analysis. In this article I'm going to discuss the use of the "unique" and "toggle" arguments, which can be used for customizing the default behavior of a given hierarchical tree even more.
In the first case, the "unique" argument will allow only one branch of the tree to be opened at a time, while the second option will trigger callback functions when the branches are closed and expanded alternately. Of course, this is pure theory that needs to be backed up with some functional code samples, so let's see how to work with these arguments in the context of a few concrete and hopefully educational examples. Let's get going!