Disabled Nodes
You can disable nodes using the TreeNode's isDisabled property.
Disabled nodes cannot be selected using the mouse or keyboard.
Electronics
Trimmers/Shavers
Tablets
Phones
Apple
Motorola
Nokia
Samsung
Speakers
Monitors
Toys
Shopkins
Train Sets
Science Kit
Play-Doh
Crayola
Home
Coffeee Maker
Breadmaker
Solar Panel
Work Table
Propane Grill
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | // This file locates: "Scripts/Lesson/C1Nav/Disabling.js". c1.documentReady(function () { var tree = wijmo.Control.getControl( '#theTree' ); document.getElementById( 'btnDisableNode' ).addEventListener( 'click' , function (e) { var nd = tree.selectedNode; if (nd) { nd.isDisabled = true ; } }); document.getElementById( 'btnEnableAllNodes' ).addEventListener( 'click' , function (e) { for (var nd = tree.getFirstNode() ; nd; nd = nd.next()) { nd.isDisabled = false ; } }); }); |
1 2 3 4 5 6 7 8 9 10 11 12 | // This file locates: "Content/css/Lesson/C1Nav/Disabling.css". /* default trees on this sample */ .demo-control .wj-treeview { display:block; height: 350px; font-size: 120%; margin-top: 8px; margin-bottom: 8px; padding: 6px; background: #f0f0f0; box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 | using System.Web.Mvc; namespace LearnMvcClient.Controllers { public partial class C1NavController : Controller { // GET: Disabling public ActionResult Disabling() { return View(Models.TreeViewData.GetData(Url)); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @model IEnumerable< TreeViewData > < h1 > @Html .Raw(Resources.C1Nav.Disabling_Title) </ h1 > < p > @Html .Raw(Resources.C1Nav.Disabling_Text1) </ p > < p > @Html .Raw(Resources.C1Nav.Disabling_Text2) </ p > < button id = "btnDisableNode" class = "btn btn-default" > @Html .Raw(Resources.C1Nav.Disabling_Text3) </ button > < button id = "btnEnableAllNodes" class = "btn btn-default" > @Html .Raw(Resources.C1Nav.Disabling_Text4) </ button > @Html .C1().TreeView().Id( "theTree" ).Bind(Model).DisplayMemberPath( "Header" ).ChildItemsPath( "Items" ) |