Mohaideen Ismail
Mohaideen Ismail

Reputation: 314

How to get json data from Kendo UI treeview select event

I have retrieving the data from json for treeview. When i select the treeview, it will show the data which is belong from same json. How to get the data from json

 console.log("select",k.node)

This is used for get the data for selected node. But I want the data from JSON.

Upvotes: 1

Views: 1178

Answers (2)

OnaBai
OnaBai

Reputation: 40887

You might do:

var item = this.dataItem(k.node);

You can see it in action here: http://jsfiddle.net/OnaBai/jtgfjz8w/1/

Upvotes: 2

Lars Höppner
Lars Höppner

Reputation: 18402

Most widgets have a dataItem method which gives you the corresponding data item in the data source:

var item = e.sender.dataItem(e.node);

Upvotes: 2

Related Questions