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

[Solved] Client-Side Expand Event: How to Access Item

1 Answer 94 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 08 Apr 2010, 07:59 PM
Hello,

I was curious how do you access the tree view item of the item that was just expanded in the JS API?  I want to access the tree view item text that was expanded, but don't see an object exposing this, according to the JS intellisense/debugger in VS.  Is that available from the event object?  Or is there another way?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 09 Apr 2010, 07:34 AM
Hi Brian Mains,

Currently you can use the approach shown in the online example. However in the next version the DOM element passed to the treeview events (as e.item) will no longer be the inner most SPAN but the LI.t-item. This should have been done in the first place for consistency with the other components.

Then you should start using something like this

var treeView = $('#TreeView').data('tTreeView');
var text = treeView.getItemText(e.item);


Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or