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

[Solved] misalignment between the grid and the database after an update

3 Answers 32 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.
Stefano
Top achievements
Rank 1
Stefano asked on 08 Apr 2013, 03:11 PM
Hi,

I'm using the Kendo grid with an editing pop up. (see scenario attach) and I have a problem of misalignment between the grid and the database after an update.

This is the test case:
I selected one row of the grid where the value inside a field is "info@example.com"   
If I click on edit, I can modify one value of my record inside the pop up. For example I insert the value "bob@example.com"  (see pop up attach)
I check on the database and the record is updated with the "bob@example.com" value.

But If i click again on the edit button of the grid and than, click on the cancel button of the pop up without any modify to the record,
when the pop up is closed I can see on the grid the original value of the cell "info@example.com", but on the database the value is "bob@example.com".

thanks in advance






3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 11 Apr 2013, 12:11 PM
Hi Alessandro,

 
From the provided information it seems that the controller returns model state error - I would suggest to debug the controller action and check if this is the case.

Kind Regards,
Vladimir Iliev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Stefano
Top achievements
Rank 1
answered on 16 Apr 2013, 07:35 AM
Hi Vladimir,

this is our code:
[AcceptVerbs(HttpVerbs.Post)]
 public ActionResult Account_Update([DataSourceRequest] DataSourceRequest request, ViewModel Erp_allView)
 {
     if (erp_allView != null && ModelState.IsValid)
     {
         //      ... UPDATE FUNCTION     
     }
     return Json(ModelState.ToDataSourceResult());
 }   

We use release 2013 Q1 and jquery 1.9.1, and Italian (it-IT) culture.
On dev envirionment (debugging in visual studio 2012) there is no problem, but when we deploy the solution on the server (IIS 7.5) the json responses are treated as fail, evenif the json response is empty.

After some Google, we find the following post about empty json conflicts with jquery 1.9.1:

jquery 1.9.1 has some problem with kendo?

we workaround our problem relacing (but it is not the final solution):
//replace
return Json(ModelState.ToDataSourceResult());
//with
return Json("");


Kind regards,
Alessandro
0
Vladimir Iliev
Telerik team
answered on 16 Apr 2013, 09:59 AM
Hi Alessandro,

 
Please note that KendoUI for ASP.NET MVC currently supports officially only jQuery v.1.7.1 and I would suggest downgrade to that version. Also jQuery v.1.9+ have breaking change which throws error when empty response is returned from the server. 

Kind Regards,
Vladimir Iliev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
Grid
Asked by
Stefano
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Stefano
Top achievements
Rank 1
Share this question
or