Tree view using jquery

I bought
and installed it
I’d like to make a modification

  1. Id like each child node in the menu to act as a link, so can change
            var tree = [
                {id: 1, parent_id: 0, name: "ADMS"},
                {id: 2, parent_id: 1, name: "ANCC"},
                {id: 3, parent_id: 1, name: "EHF"},


            var tree = [
                {id: 1, parent_id: 0, name: "ADMS"},
                {id: 2, parent_id: 1, name: "ANCC", url: "#adms-ancc"},
                {id: 3, parent_id: 1, name: "EHF", url: "#adms-ehf"}

then how do I make a window.location() event happen whenever a child node is selected?

Hi @lurtnowski, I doubt that we are allowed to post modifications to this script on a public forum then. What you might try though is modifying the generated DOM afterwards by replacing the nodes’ hrefs:

const $nodes = $('[data-id]')

tree.forEach(item => {
    .filter((_, node) => Number( ===
    .prop('href', item.url)

Other than that, please carefully check your license first.

I recommend that you use a free jQuery tree viewer instead. The FileBrowser Demo (below the basic ajax demo) shown at is a good example of what it can do. Links are all supported too.

Oh, but you mentioned filtering too. JSTree supports searching, but just in case here’s another free jQuery library that also provides filtering of a tree view.

I’ve found that frequently the paid ones don’t tend to give much of a benefit when it comes to this type of thing.

live n learn, I am going with the 2nd one (would be cool if it was filterable), how do i activate it?

Oh, it does

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.