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

[Solved] In Cell Edit and Client Side Validation

0 Answers 21 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ben
Top achievements
Rank 1
Ben asked on 05 Apr 2012, 10:21 PM
With 'Required' attributes on several model items, I'm able to get the validation to work and display a message.

BUT there are two issues that occurring differently than on the demo shown here: http://demos.telerik.com/aspnet-mvc/razor/grid/editingbatch?theme=vista

1. When no changes are made to the particular cell, it still shows the dirty flag. But the demo recognizes the value isn't changed and doesn't show the dirty flag.

2. When a cell has been invalidated, for instance the value is blank, the demo referenced above, will not allow edits in other cells. How is this done? It looks like it may be via the OnEdit function, which would need to verify if there are any t-dirty elements in the grid and if so, cancel the current edit and refocus on the t-dirty cell.

The questions are:
1. How to keep the 't-dirty' class and span from being set when the value hasn't changed?
2. How to keep the cursor in the edited cell, when validation fails?

The demo page doesn't offer any clues to how this is being performed. Please explain or show the javascript performing this.

Thanks.
Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Share this question
or