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

Requiring the user to say in a row

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Reid
Top achievements
Rank 2
Reid asked on 10 Jun 2016, 05:28 PM

I have a grid where a button on the form calls addRow().  So the row is in insert mode.  How do I prevent the user from leaving the row until the values entered have been entered and are valid.  Right now it is showing the hints when the user goes to another column without completing the cell but the user can completely leave the row and it remains empty of values.

 

Is there a way to call validate before calling grid.saveChanges()?

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 14 Jun 2016, 01:07 PM
Hi Reid,

You can try experimenting with 2 things here. The first one is the onblur event. Find out which input is being focused when the addRow() method is executed and use its onblur event handler to prevent leaving the input if the requirements are not satisfied. Or after blur happens and the conditions are not met, re-focus the input using its focus() method.

As for your last question, the grid provides the saveChanges event which is raised when the user initiates save action:
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-saveChanges

I hope this will prove helpful.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Reid
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Share this question
or