I'm trying to write an event handler for server model validation errors. Its firing and poping a message but I have a grid that im editing in batch mode. I'd like to have the red dog ears in the upper right of the cells stay after the method presents the window to the users, but I can't get the dog ears to stay. Heres what I'm trying:
if i uncomment and try
the dog ears go away, and it looks to users as if the records were saved.....
if i uncomment and try
The updates are gone, the grid removes the new rows that the users tried to add which isn't what i want either, i want the grids state to be in effect unchanged, that is the content that they tried to add is still in the cells and the dog ears are still there.
How do i accomplish this?
Thanks,
Chris
<script type=
"text/javascript"
>
function
showAlertWindow(message) {
var
alertWindow = $(
'#alertWindow'
).data(
'kendoWindow'
);
alertWindow.content(message);
alertWindow.refresh();
alertWindow.center();
alertWindow.open();
}
function
server_error_handler(event) {
if
(event.errors) {
event.sender.one(
"dataBinding"
,
function
(e){
e.preventDefault();
});
//event.preventDefault();
//event.sender.cancelChanges();
var
message =
"Errors:\n"
;
$.each(event.errors,
function
(key, value) {
if
(
'errors'
in
value) {
$.each(value.errors,
function
() {
message +=
"</br><strong>"
+ key +
"</strong>: "
+
this
+
" \n"
;
});
}
});
message +=
" </br> </br> <strong>No updates were saved!</strong>"
;
showAlertWindow(message);
}
}
</script>
if i uncomment and try
//event.preventDefault();
the dog ears go away, and it looks to users as if the records were saved.....
if i uncomment and try
//event.sender.cancelChanges();
The updates are gone, the grid removes the new rows that the users tried to add which isn't what i want either, i want the grids state to be in effect unchanged, that is the content that they tried to add is still in the cells and the dog ears are still there.
How do i accomplish this?
Thanks,
Chris