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

[Solved] Treeview MVC: Inherit the the Checked state of the parent Node when loading Nodes on demand

1 Answer 23 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.
Denis Costa
Top achievements
Rank 1
Denis Costa asked on 03 Aug 2011, 07:20 PM
How build a MVC TreeView with checkboxes that inherit the the Checked state of the parent Node using loading on demand?

1 Answer, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 04 Aug 2011, 08:14 AM
Hello Denis,

  1. Bind an event handler to the OnDataBound event
  2. In the event handler, set the checked state of the newly loaded items to that of the parent item

However, the dataBound event does not report which node has been updated. In order to make it report it, change the following line in telerik.treeview.js
$t.trigger(this.element, 'dataBound');
with
$t.trigger(this.element, 'dataBound', { item: $item[0] });

Then you can access the data-bound item through the e.item property of the dataBound event. This change will be included in the next internal build, so you won't have to keep track of it when you upgrade.
Hope this helps,
Alex Gyoshev
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
Denis Costa
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or