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

Grid looks like accepted an update even on server errors

2 Answers 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 21 Aug 2012, 07:08 PM
Hi,

A field of my Kendo UI Grid cannot be duplicated. On Telerik Extensions for ASP .NET MVC I was using Remote validation and it was ok.
Now, using KendoUI, this field is not validated on client, just on server. The problem is that, after clicking Update button, grid looks like changes were accepted, but if you see the response of ajax call, you realize that the error message is there, but it isn't displayed because it's no more on edit mode.

Something similar occurs on the example provided with Wrappers for KendoUI, Collumn Settings (http://localhost:53702/razor/web/grid/columnsettings). If I edit a row, change any field's value and click on Update, it looks like changes where accepted, but an alert is showed: "Errors: The value '1/17/2012 12:00:00 AM' is not valid for Last supply".
The problem is not converting the date to the format accepted by my OS... but it should display the error during edit mode, using Kendo Validation, to be clear that this data was not updated.

How to achieve this behavior?

Tks

2 Answers, 1 is accepted

Sort by
0
Anish
Top achievements
Rank 1
answered on 03 Oct 2012, 04:12 PM
buddy , im facing the same issue ..could u have any updates on this ?? guys anone can help ??
0
Daniel
Top achievements
Rank 1
answered on 03 Oct 2012, 06:38 PM
Hi, Anish

I had posted it on the wrong forum, so I re-posted it on MVC here:

http://www.kendoui.com/forums/mvc/grid/grid-looks-like-accepted-an-update-even-on-model-errors.aspx

If you want to perform a remote validation then the above link will help, but if you want to show server erros, you can do the following:

function grid_error (e) {
    if (e.errors) {
        var message = "Please verify:\n";
        $.each(e.errors, function (key, value) {
            if ('errors' in value) {
                $.each(value.errors, function () {
                    message += this + "\n";
                });
            }
        });
        alert(message);
    }
}

Hope it helps!
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Anish
Top achievements
Rank 1
Daniel
Top achievements
Rank 1
Share this question
or