Requiring the user to say in a row

2 posts, 0 answers
  1. Reid
    Reid avatar
    317 posts
    Member since:
    Oct 2008

    Posted 10 Jun Link to this post

    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()?

     

  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 14 Jun Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top