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

Access dataItem inside transport.read function

1 Answer 74 Views
Hierarchical Data Source
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 24 Feb 2014, 09:29 PM
I have a TreeView with HierarchicalDataSource and my question is simple: Can I access the current dataItem in the transport.read function?

For instance, consider this code:

new kendo.data.HierarchicalDataSource({
    transport: {
        read: function() {
            // Here i'll prepare my url to be called
            return "my/controller/" + dataItem.Id;
        }
    }
});

I want to access the dataItem's properties of the current expanding node inside the read function. Is this possible?

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 25 Feb 2014, 07:28 PM
Hello Fernando,

Yes, the id is provided through the argument of the read function. See the full example in the documentation.

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
Hierarchical Data Source
Asked by
Fernando
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or