Access dataItem inside 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 function?

    For instance, consider this code:

        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
    Alex Gyoshev avatar
    2498 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.

    Alex Gyoshev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top