ODataV4 Grid stuck with loading animation after edit

Hi, 

I've an ODataV4 Grid stuck with loading animation after edit without any error message client or server side, in fact if I reload the page the field has the new value.
EJ2 aspnetcore v. 16.1.0.32 and 34

7 Replies

RS Renjith Singh Rajendran Syncfusion Team April 12, 2018 01:51 PM UTC

Hi Emanuele, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. Since we are not certain about the issue we require more details to look into this issue further. Please share with us the following details, 

  1. Please share the screenshot of the network tab with the post request sent while saving.
  2. Share the screen shot or video demonstration of the issue.
  3. Share full Grid code example.
  4. Share the stack trace of the issue if any script error occur in console window.

And also if there is failure in the save action then the actionFailure event will be triggered. Please bind this actionFailure event to your Grid and share the arguments you get in that event function call. Please use like the code below, 

<div> 
    <ejs-grid id="Grid" allowPaging="true" actionFailure="failure"> 
        ... 
   </ejs-grid> 
</div> 
 
<script> 
    function failure(args) {   //Share whatever you get in this args. 
        debugger; 
    } 
</script> 


The provided information will help us to analyze the issue and provide you the response as early as possible. 

Regards, 
Renjith Singh Rajendran. 



EF Emanuele Filardo April 19, 2018 01:35 PM UTC

Can you tell me what is your the expected return of PUT: Accepted, NoContent, Updated, ... ?
thanks


RS Renjith Singh Rajendran Syncfusion Team April 20, 2018 01:13 PM UTC

Hi Emanuele, 

The PUT request will be triggered when save action is performed after editing in Grid. The expected return for PUT is the edited record value. The edited record value will be obtained as an argument in the PUT request. Then we will be returning the edited record value in PUT request. Please refer the code example below, 

        [HttpPut] 
        public object Put(int id, [FromBody]OrdersDetails value) 
        { 
            var ord = value; 
            OrdersDetails val = OrdersDetails.GetAllRecords().Where(or => or.OrderID == ord.OrderID).FirstOrDefault(); 
            val.OrderID = ord.OrderID; 
            ... 
           return value; 
        } 

We have prepared a simple WebApiAdaptor sample with editing enabled in Grid, which could be downloaded from the link below, 

 
But still we are not certain about your exact issue you are facing, if still your issue is not resolved, please get back to us with the following details, 

  1. Please share the screenshot of the network tab with the post request sent while saving.
  2. Share the screen shot or video demonstration of the issue.
  3. Share full Grid code example.
  4. If possible please share an issue reproducing sample.
  5. Share the stack trace of the issue if any script error occur in console window.

And also if there is failure in the save action then the actionFailure event will be triggered. Please bind this actionFailure event to your Grid and share the arguments you get in that event function call. Please do as mentioned in our previous update. 

Regards, 
Renjith Singh Rajendran. 



EF Emanuele Filardo April 20, 2018 01:46 PM UTC

The example is for webapi ... I have OData Controller


EF Emanuele Filardo replied to Emanuele Filardo April 20, 2018 02:00 PM UTC

The example is for webapi ... I have OData Controller

Found the problem, since my PUT method return IActionResult, I have to set result as Ok(object).

With Update(object), No Content(object) or Accepted(object) dont work.



EF Emanuele Filardo April 20, 2018 02:02 PM UTC

Have you planned to support PATCH in ODavaV4Adaptor, without require a customAdaptor?


RS Renjith Singh Rajendran Syncfusion Team April 25, 2018 10:39 AM UTC

Hi Emanuele, 

We have prepared a sample to perform editing operation with ODataV4Adaptor. We have performed the editing operation with an ODataV4 service in which the editing works fine. For that, we have created an ODataV4 service project for server side and ASP.NET Core project for client side. Please download the sample from the below link, 

 
 
Note : Run the OData Service application first, then run the asp.net core sample to render the Grid and perform editing. 

In the above sample, we have performed editing and returned the data object. Please refer the below code example to know how to return the values after performing editing, 

[Index.cshtml]  
 
    <ejs-grid id="Grid"> 
        //Here the URL is a localhost link which is taken from the ODataV4 service project 
        <e-datamanager url="http://localhost:49438/odata/Orders" adaptor="ODataV4Adaptor"></e-datamanager> 
        ... 
   </ejs-grid> 
 
[OrdersController.cs] 
 
        public async Task<Order> Put(int key, [FromBody]Order order) //Edit operation in database 
        {  
           var entity =  await db.Orders.FindAsync(order.OrderID); 
           db.Entry(entity).CurrentValues.SetValues(order); 
           await db.SaveChangesAsync(); 
           return order; 
        } 

Note : You can perform editing with the PUT action. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Up arrow icon