Charles
Charles

Reputation: 146

which is the best treeview jquery plugin to use in MVC?

Which is the best treeview jquery plugin to use in MVC ?

I'm bit confused which one to use ?

  1. jquery Treeview
  2. dyna tree view
  3. jstree TreeView
  4. any other ?

I have been working on a huge project which have atleast 6 screens which will have tree view to display dynamic data with checkboxes,links etc.

Upvotes: 5

Views: 8292

Answers (2)

Chetan
Chetan

Reputation: 5095

Jstree is a good option but it's documentation is not satisfactory, you will definitely have pain in getting tasks done , but once you understand it then its simple.

I would suggest before you starting the project list down all the operations you will be doing on tree so that the best choice can be made.

You need to have very good knowledge about javascript, ajax, jquery in order to use jstree efficiently or you might get stuck up badly.

you can also have a look at zTree in case.

Also one more option but is not MIT license , i.e. Extjs , it is very good with lot of other components ready to use but there is a leaning curve for it and you cant get started with it right away.

I would once again suggest you to list the all possible operations you will be doing on tree so that I can tell you whether jstree is a good option or not because being working on a project where tree view was required I have some experience over jstree .

Upvotes: 1

Mortalus
Mortalus

Reputation: 10712

I Don't know abut the best.. but JStree is pretty good an comprehensive ...

http://www.jstree.com/

I have also create a server wrapper that will allow you to easily create the tree view using a simple html helper

https://jstreemvcwrapper.codeplex.com/

here is the basic usage code example:

@(Html.JSTreeView(Model.TreeNodes)
.ContrainerID("TreeContainer")
.Children(n => n.Childern)
.ItemID(n=>n.NodeID.ToString())
.ItemType(n=>n.NodeType.ToString())
.IsSelected(n=> n.NodeID == 1)
.OnNodeSelect("onTreeFolderSelected")
.Plugins("wholerow", "types")
.CoreConfig(new
{
      expand_selected_onload = true,
      multiple = false
})
.TypesConfig(new
{
      Root = new { icon = "../Content/jsTree/Root.png" },
      Folder = new { icon = "../Content/jsTree/Folder.png" },
      File = new { icon = "../Content/jsTree/File.png" },
      @default = new { icon = "../Content/jsTree/Folder.png" }
})
.ItemTemplate(@<text> <a href="#" >@item.NodeName</a> </text>))

Upvotes: 3

Related Questions