Spinner does not stop on any action

Hi,
When we (bulk) add, Edit or delete, on update button click spinner starts running but does not stop even action finished.

Below is my Grid

 <ejs-grid id="CoursesGrid" toolbar="@(new List<string>() { "Add", "Delete","Edit","Update", "Cancel" })" allowTextWrap="true" gridLines="Horizontal" childGrid="GradesGrid" allowPaging="true" load="LoadCourses" rowDataBound="RowCourseDataBound" enableHover="true" rowHeight="30" allowFiltering="true" allowSorting="true" queryCellInfo="GetToolTip">
            <e-data-manager url="/Courses/GetCourses" adaptor="UrlAdaptor" batchUrl="@Url.Action("BulkCoursesUpdate", "Courses")"></e-data-manager>
            <e-grid-editSettings allowDeleting="true" allowEditing="true" allowAdding="true" showConfirmDialog="true" showDeleteConfirmDialog="true" mode="@EditMode.Batch"></e-grid-editSettings>
            <e-grid-filterSettings type="Menu"></e-grid-filterSettings>
            <e-grid-pagesettings pageCount="10" pageSize="20"></e-grid-pagesettings>
            <e-grid-columns>
                <e-grid-column field="CourseID" isIdentity="true" type="string" isPrimaryKey="true" visible="false"></e-grid-column>
                <e-grid-column field="CourseName" headertext="Course Name" type="string" validationRules="new { required=true }"></e-grid-column>
            </e-grid-columns>
        </ejs-grid>

4 Replies 1 reply marked as answer

SS Suchita salunkhe December 18, 2020 06:53 PM UTC

Get and update functions for grid are:

public async Task<IActionResult> GetCourses([Microsoft.AspNetCore.Mvc.FromBody] DataManagerRequest dm)
        {
            IEnumerable DataSource = await _courseRepository.GetCourses(SchoolBranchId);
            var operation = new DataOperations();

            if (dm.Search != null && dm.Search.Count > 0)
                DataSource = operation.PerformSearching(DataSource, dm.Search);  //Search

            if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting
                DataSource = operation.PerformSorting(DataSource, dm.Sorted);

            if (dm.Where != null && dm.Where.Count > 0) //Filtering
                DataSource = operation.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator);

            int count = DataSource.Cast<CourseModel>().Count();
            if (dm.Skip != 0)
                DataSource = operation.PerformSkip(DataSource, dm.Skip);   //Paging

            if (dm.Take != 0)
                DataSource = operation.PerformTake(DataSource, dm.Take);

            return dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource);
        }

public async Task<IActionResult> BulkCoursesUpdate([Microsoft.AspNetCore.Mvc.FromBody] CRUDModel<CourseModel> model) 
        {
            if (model.Added != null && model.Added.Count > 0)
            {
                await _courseRepository.BulkInsert(model.Added, SchoolBranchId);
            }

            if (model.Changed != null && model.Changed.Count > 0)
            {
                await _courseRepository.BulkUpdate(model.Changed);
            }

            if (model.Deleted != null && model.Deleted.Count > 0)
            {
                await _courseRepository.BulkDelete(model.Deleted);
            }

            return Json(model.Value);
        } 


BS Balaji Sekar Syncfusion Team December 21, 2020 02:23 PM UTC

Hi Suchita, 
 
Greetings from the Syncfusion support. 
 
We have validated your query with provided the information and we found that you have returned data is incorrect from the batchUrl of server method(BulkCoursesUpdate). We suggest you to return the updated data after added/deleted/Updated action in the batchUrl of server side method so please refer the below code example and sample for more information. 
 
[Index.cshtml] 
public ActionResult BatchUpdate([FromBody]CRUDModel batchmodel) 
        { 
            if (batchmodel.Changed != null) 
            { 
                for (var i = 0; i < batchmodel.Changed.Count(); i++) 
                { 
 
                    var ord = batchmodel.Changed[i]; 
                    Orders val = Orders.getAllRecords().Where(or => or.OrderID == ord.OrderID).FirstOrDefault(); 
                    val.OrderID = ord.OrderID; 
                    val.EmployeeID = ord.EmployeeID; 
                    val.CustomerID = ord.CustomerID; 
                    val.Freight = ord.Freight; 
                    val.OrderDate = ord.OrderDate; 
                    val.ShipCity = ord.ShipCity; 
                    val.ShipCountry = ord.ShipCountry; 
                } 
            } 
 
            if (batchmodel.Deleted != null) 
            { 
                for (var i = 0; i < batchmodel.Deleted.Count(); i++) 
                { 
                    Orders.getAllRecords().Remove(Orders.getAllRecords().Where(or => or.OrderID == batchmodel.Deleted[i].OrderID).FirstOrDefault()); 
                } 
            } 
 
            if (batchmodel.Added != null) 
            { 
                for (var i = 0; i < batchmodel.Added.Count(); i++) 
                { 
                    Orders.getAllRecords().Insert(0, batchmodel.Added[i]); 
                } 
            } 
            var data = Orders.getAllRecords().ToList(); 
            return Json(data); 
 
        } 
 
 
Please get back to us, if you need further assistance. 
 
Regards, 
Balaji Sekar 


Marked as answer

SS Suchita salunkhe December 22, 2020 08:28 AM UTC

Hi,

Thank you so much Balaji Sekar.
This issue resolved now :)

Regards,
Suchita



BS Balaji Sekar Syncfusion Team December 23, 2020 04:33 AM UTC

Hi Suchita, 
  
We glad that your issue has been fixed.  
  
Please get back to us if you require further other assistance from us. 
  
Regards, 
Balaji Sekar. 


Loader.
Up arrow icon