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

HierarchicalDataSource, how to re-fetch data

6 Answers 199 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Iwhp
Top achievements
Rank 1
Iwhp asked on 14 Aug 2012, 06:48 AM
By using a HierarchicalDataSource, the first time a node is expanded, the data is fetch from the data source.
The next time, the data is not retrieved from the data source.
How can one define, that on each expand, the data should be fetched from the data source?

6 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 14 Aug 2012, 09:10 AM
Hello Harry,

Set the loaded flag of the datasource Node to false.

Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Iwhp
Top achievements
Rank 1
answered on 14 Aug 2012, 10:10 AM
Thankx! I tried the following:

treeview.bind("expand", function (e) {
    e.node.loaded(false);
});

but the .loaded function is not defined here. Are there other options?
0
Accepted
Alex Gyoshev
Telerik team
answered on 14 Aug 2012, 12:59 PM
Hello Harry,

The loaded function is part of the HierarchicalDataSource Node object (rather than of the DOM object of the treeview node):

// get the Node object (model)
var dataItem = this.dataItem(e.node);
dataItem.loaded(false);

Kind regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Iwhp
Top achievements
Rank 1
answered on 14 Aug 2012, 01:33 PM
Thankx a lot, it is getting the data now.

So one small issue remains on my side:

BUG: the visual indicator, that the data is fetched from the data source, is not shown the second time.
Workaround: When I collapse the parent above the one which should be fetched and then open the child, then the indicator is shown.
0
Alex Gyoshev
Telerik team
answered on 15 Aug 2012, 01:45 PM
Hello Harry,

We have made some improvements in the next internal build, which should be available in a few hours. Please try it out and see if the bug persists.

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Greg
Top achievements
Rank 1
answered on 22 Aug 2012, 03:32 AM
Finally found what I needed...thank you for this information!
Tags
TreeView
Asked by
Iwhp
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Iwhp
Top achievements
Rank 1
Greg
Top achievements
Rank 1
Share this question
or