Bind to nested, computer property

7 posts, 1 answers
  1. Jonathan
    Jonathan avatar
    37 posts
    Member since:
    Jul 2012

    Posted 30 Jul 2012 Link to this post

    In javascript how can you watch changes to a nested property or computed property on an observable object?

    http://docs.kendoui.com/api/framework/observableobject#methods has observable.bind("change", function(e) { }); but this does not seem to update for nested properties/computed properties.

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 31 Jul 2012 Link to this post

    Hello Jonathan,

     The change event should be raised for nested properties. Here is a live demo showing this in action: http://jsbin.com/iqukaz/1/edit 

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Jonathan
    Jonathan avatar
    37 posts
    Member since:
    Jul 2012

    Posted 31 Jul 2012 Link to this post

    Thank you. I did not realize that it would work for nested properties. How do you suggest watching computed properties
    http://jsbin.com/iqukaz/3/edit 
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 01 Aug 2012 Link to this post

    Hello Jonathan,

     Could you please elaborate a bit on your requirement? What exactly are you trying to achieve?

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Jonathan
    Jonathan avatar
    37 posts
    Member since:
    Jul 2012

    Posted 08 Aug 2012 Link to this post

    Since I can watch nested properties, updating computed properties is not a large issue.

    Although I have noticed an issue when trying to bind to nested arrays. Is there any guidance on a situation such as http://jsbin.com/abigum/2/edit?
  6. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 09 Aug 2012 Link to this post

    Hi Jonathan,

     What seems to be the problem?

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  7. Jonathan
    Jonathan avatar
    37 posts
    Member since:
    Jul 2012

    Posted 09 Aug 2012 Link to this post

    I must have been very tired when I posted those two questions. Kendo MVVM is working well!!

    I have had issues with binding to the mobile checklist form with nested properties, but it is likely something I am doing wrong. Instead of binding, I am manually observing changes and it works well.'

    Thanks for your patience.
Back to Top