This is a migrated thread and some comments may be shown as answers.

.data on TreeView method page

1 Answer 13 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 1
Paulo asked on 24 Sep 2011, 10:00 PM
Hello,

On the TreeView Demo page (http://demos.kendoui.com/treeview/index.html) , select Methods tab -> expand.
You'll see the sample code: 
var treeview = $("#treeview").data("kendoTreeView");

  What is the ".data" function/method ?
  Thank you very much and sorry for this very basic question.

Paulo.

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 26 Sep 2011, 09:04 AM
Hello Paulo,

.data is actually the jQuery .data method. When an element is initialized as Kendo widget (kendoTreeView),
i.e $("#treeview").kendoTreeView(); 
a reference to the kendo object is assigned to the element #treeview.
This reference is set via data method and the key is formatted as kendo+widget name (kendoTreeView).

Greetings,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Paulo
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or