Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Possibility to override function used to determine current node #28

wants to merge 1 commit into from

2 participants


No description provided.


I don't really work on this plugin, and don't want to merge this as-is. Adding more options is rarely a good idea. Could you explain your usecase, that is, what does your custom option look like in your app? Maybe there's a simple way to make the option-less approach work in both cases.


I have a tree on the left of my page, and courbes with fields (dates and period)

When I click a link on the tree, I get a default courbe, with fields pre filled (last hour, and 10 seconds as period)
But I can change the dates and/or the period saying to show the last month with 1 hour as period

So my url contains parameters for the tree but also for my dates and period fields
The dates and period parameters are specific for each node of the tree, they do not match from one node to another.

So I do not want the tree to check for these parameters to determine the current node


This plugin isn't maintained anymore.

@jzaefferer jzaefferer closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 jquery.treeview.js
9 jquery.treeview.js
@@ -101,7 +101,10 @@
treeview: function(settings) {
settings = $.extend({
- cookieId: "treeview"
+ cookieId: "treeview",
+ isNodeTheSelectedOneFunction: function(node) {
+ return node.href.toLowerCase() == location.href.toLowerCase();
+ }
}, settings);
if ( settings.toggle ) {
@@ -205,7 +208,7 @@
case "location":
var current = this.find("a").filter(function() {
- return this.href.toLowerCase() == location.href.toLowerCase();
+ return settings.isNodeTheSelectedOneFunction(this);
if ( current.length ) {
// TODO update the open/closed classes
@@ -253,4 +256,4 @@
hitarea: "hitarea"
Something went wrong with that request. Please try again.