Hi DevExpress,
I am just using the DropDown Treeview control and my company is very impressed on how rich the functionality is - brilliant work. I just have a query. I am just trying to get the name of the parent node selected. I am using the getSelectedNodes function but cannot get the selected parent name(Category Name) e.g. "Promise To Pay". Any clues ?
View
@(Html.DevExtreme().TreeView()
.DataSource(new JS(@"component.getDataSource()"))
.ID("statusTreeView")
.KeyExpr("ID")
.DisplayExpr("Text")
.ItemsExpr("Items")
.ExpandedExpr("Expanded")
.ParentIdExpr("CategoryId")
.DataStructure(TreeViewDataStructure.Plain)
.SelectionMode(NavSelectionMode.Single)
.SelectByClick(true)
.Height(235)
.OnItemSelectionChanged(@<text>
JavaScript to display the selected values
var selected = treeView.getSelectedNodes()
.map(function (node) { return node.itemData; });
if (selected.length) {
if (selected[0].CategoryId) {
console.log(selected);
Kind Regards
Akshay