Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 438
Charles Avatar asked Oct 01 '22 04:10

Charles


2 Answers

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>))
like image 67
Mortalus Avatar answered Oct 03 '22 16:10

Mortalus


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 .

like image 24
Chetan Avatar answered Oct 03 '22 18:10

Chetan