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

onDataBound is fired when nothing is ready yet

1 Answer 61 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 01 May 2014, 08:27 AM
Hi, 

At first, I understood that the "onDataBound" event of the TreeView would indicate that my tree is "ready".
However, this is clearly not the case, and I'm wondering if there's nothing else I can use or if this is a known issue.

I use a hierarchical data and a transport/url to read the data (see code snippet below).
The OnDataBound event throws alright, but at this point in time, nothing can be done on the tree. Expanding items, looking for items. Nothing.
I currently put a 1500 millisecond timeout inside the OnDataBound and then call "expand" on the tree's first node... this which works most of the time - but not always, depending on the network.
Which means, the onDataBound is not even close to the event I need.
Is this expected/known or am I missing something here? Is there an event that I can use to indicate that the tree is ready (at the moment I just want to expand all nodes, eg -> tree.expand $("#treeName .k-item:first") and this doesn't work)

_treeViewDataSource = new kendo.data.HierarchicalDataSource(
  transport:
  read:
  url: options.dataUri
  dataType: "json" 
  data: postData
  cache: false

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 02 May 2014, 03:11 PM
Hello Peter,

Can you please provide a sample that shows the problem? Here is one that uses the databound event to expand all nodes in a remote-bound TreeView.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeView
Asked by
Peter
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or