"Too much recursion" error when binding to nested observable function dependant method

2 posts, 0 answers
  1. Sam
    Sam avatar
    3 posts
    Member since:
    Feb 2018

    Posted 21 Nov 2018 Link to this post

    I'm getting a "too much recursion" error when using a kendo.observable with nested dependent method. I have a nested observable object that needs to get and set values for a field depending on another field's value, so I used the example from the ObservableObject docs, where you have a field bound to a function that gets or sets a value based on whether a parameter is passed in.  This works great when the function is on the top level of the kendo.observable, but when it's nested several levels deep, there's some odd behavior...  Here's a Dojo example:

    https://dojo.telerik.com/UpUcaxaP/2

    It seems to work when you call the nested dependent function directly in JS or from the console, but as soon as it's bound to the HTML input field with data-bind, it gives the "too much recursion" error.  If you comment out the "this.set('nestedValue', param);" line, then you don't get the recursion error on binding, but when you change the value in the input box you get "TypeError: d.fields is undefined".  I've tried with both the straight use of "this" and also with the "self" one-liner referenced in my other post, and haven't been able to get it to work correctly.  Any ideas on what I'm doing wrong?

    Thanks!

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2053 posts

    Posted 23 Nov 2018 Link to this post

    Hello Sam,

    Similarly to the other thread binding the value of the input to a nested method can be done by using a template. Here's the updated dojo.

    Regards,
    Ivan Danchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top