Access dataItem inside transport.read function

2 posts, 0 answers
  1. Fernando
    Fernando avatar
    56 posts
    Member since:
    Sep 2012

    Posted 24 Feb 2014 Link to this post

    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?
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 25 Feb 2014 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top