.set causes endless loop in save function

1 Answer 18 Views
Grid
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Lee asked on 19 Jan 2026, 07:15 PM | edited on 19 Jan 2026, 07:35 PM

I have a grid with a local data source and some editable cells. When a user changes one of the cell's values, it needs to run a few different api calls to get the new values for some of the other cells and then display those. The problem is that when I call .set("fieldName", "value") inside the save command, I get an endless loop. How do I fix this? I have attached a Dojo showing what I mean. If you change the name in the Dojo, the age and DOB should change to something else (I know my example is a little silly given the fields but this is just an example, my real fields are different). Instead, I get an endless loop in the console. 

https://dojo.telerik.com/wmQNdSaZ

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 22 Jan 2026, 09:37 AM

Hello Lee,

Thank you for the dojo example and the details provided.

Yes, you are totally correct - the changes in the save event handler are starting an infinite loop.

In order to achieve the desired behavior, I would recommend using the edit event handler and batch edit mode:

// In the Grid:
  edit: function(e) {
    	console.log("name is modified");
    	e.model.set("age", 100);
    	e.model.set("birthday", "1/1/1900");
    }

// In the DataSource:
batch: true,
Here is a dojo example:

Feel free to test the dojo example on your side and let me know if this is the desired result.

Kind Regards,
Anton Mironov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Answers by
Anton Mironov
Telerik team
Share this question
or