This is a migrated thread and some comments may be shown as answers.

Retain the old value of the cell when the update event of the data source gives error.

1 Answer 69 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Anagha
Top achievements
Rank 1
Anagha asked on 04 May 2017, 07:02 AM

Hi,

I am trying to edit a cell inline. When there is an error in the update controller, the model state returns an error but the cell value gets changed to the edited value which threw error. I want to retain the earlier value if there are any errors in the model state without calling the data source read() method.

Is there any way to achieve this?

 

Thank you.

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 05 May 2017, 12:25 PM
Hello Anagha,

By default, when an error has been returned from the controller on inline Task edit, the edited value will be reverted to the last valid value, without the need to cal the DataSource read() method. Here you will find a small Dojo sample, that demonstrates the above. You will notice, that the Update URL is not a correct endpoint, so a 404 error is returned to the client.

Thus, in case of any issues with the model state on the server, I would suggest you to return an error from the controller action, so the value would be reset.

Regards,
Veselin Tsvetanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Gantt
Asked by
Anagha
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or