0

I have an Array. The elements of this array is actually string paths to items:

  • Category1/subCategory1/item1
  • Category1/subCategory1/item2
  • Category1/subCategory1/item3
  • Category1/item4
  • Category2/item5
  • Category2/item6
  • Category3/subCategory3/item7
  • Category3/subCategory3/item8
  • item9
  • item10

I want to use jQuery to convert this to a TreeView menu. I did it with servercode both in PHP & ASP.NET C#, but just couldn't figure out how to achieve the same just using jQuery without any backend code involved.

Can someone here point me in right direction...

Thanks.

1
  • Could you post your C#/PHP/ASP.NET code? Commented Mar 14, 2011 at 3:45

1 Answer 1

1

I think you'll want to use jsTree to help you out here. jsTree is a tree view that is done entirely in JavaScript. It has a well-defined structure for populating the tree (JSON, HTML or XML data structure) and you can easily take those strings (within the array) in jQuery, convert them to the appropriate structure, and then have jsTree build based on your new structure.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks... sounds like jsTree is the way to go. I am going to try sometime this week and keep posted....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.