Question about accessing a hierarchic observable

2 posts, 0 answers
  1. Randall
    Randall avatar
    1 posts
    Member since:
    May 2013

    Posted 14 Oct 2014 Link to this post

    I have a hierarchic javascript object that I pass to kendo observable. Is it better to use get and set on the top-level object with dotted path into the object?

    Or is it better to use get and set on the lowest level of the hierarchy?

    Here is a simple jsfiddle sample that demonstrates that both forms work. I just want to know if there is any difference that I should be aware of.


  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 16 Oct 2014 Link to this post

    Hello Randall,

    Using the full path is preferred. The other approach works because MVVM in some scenarios needs to search in depth to find such property.

    Here is another example that should show you better the difference.

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