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

Order of events in TreeView & its DataSource...

1 Answer 79 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ken De Vries
Top achievements
Rank 1
Ken De Vries asked on 25 Jan 2016, 02:40 AM

I am curious about the timing of events for the TreeView and the Datasource.

 I am trying to scroll a Treeview control's contents so that the expanded event is scrolled to the top.  I have gotten this to work for the most part.  You can read my solution in another thread.  However, I am seeing the TreeView's Expand event fire before the datasource RequestStart and RequestEnd events.

This order does not seem to make sense.  My scrolling of the treeview's selected node malfunctions periodically because the expand event fires first, before the datasource returns the data for the expanded node.  This results in the scrolling not happening at all sometimes if returning the data takes a while.

Is this design intentional?  If so, is there a way around it?  If Javascript were multi-threaded, I could easily get around this but I cannot seem to come up with a way to get around this problem.

I would like to delay the Expand event until after the datasource RequestEnd event.

Possible?

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 26 Jan 2016, 11:42 AM
Hello Ken,

I am afraid that this behavior is by design. The internal logic behind this is the fact that the DataSource's request for child items is triggered once the parent one is expanded. Otherwise, the control cannot be aware when exactly the request should be fired, unless an user interaction occurs (by expanding certain Item).

Regards,
Nencho
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
TreeView
Asked by
Ken De Vries
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or