views:

19

answers:

1

Hi All,

given a hierarchical view on my asp.net mvc page is it possible to type in the search field and have the treeview dynamically filter out the tree as more letters are typed but leave the root nodes alone (like don't include north,south,east,or west)?

Thanks,

rod.

[TextBox filter goes here]

[treeview control below] /* I'm looking at jquery treeview for this. */
north
    new york
    pennsylvania
south
    alabama
    georgia
east
    north carolina
    virginia
west
    california
    washington
A: 

I'm just implementing one, this may be interesting for your case. Not with asp.net-mvc, but using a templating engine which has a similar approach I guess.

Here are the steps to get the tree:

  1. The user type a character pattern in the input box
  2. The browser calls the server with the pattern
  3. The server finds the items matching the pattern. These are the leafs of the tree.
  4. Then for each item, fetch their parents to build a tree structure in JSON
  5. The JSON is sent back to the browser and rendered as HTML

The tree is presented fully open to the user with all matching items highlighted. The visual aspect of a moving tree is good.
I don't have an url for a demo yet, but it will be soon in production.

Mic