Grid doesn't recognize update - stays in edit mode

2 posts, 0 answers
  1. Jerry
    Jerry avatar
    4 posts
    Member since:
    Jul 2010

    Posted 09 Apr 2013 Link to this post

    I have a Kendo.Grid that remains in edit mode after updating.  The only difference between my code and the demo code (that I can tell) is I'm using a third party ORM.  The demo works fine.  

    When/how does the grid know the data is persisted correctly?

    Grid in View:

    @(Html.Kendo()
        .Grid<Copper.Domain.Entities.EntInventory>()
        .Name("_gridCellInventory")
        .Columns(columns =>
        {
            columns.Bound(c => c.DeviceName);
            columns.Command(cmd => cmd.Edit());
        })
        .Editable(editable => editable.Mode(GridEditMode.InLine))
        .Pageable()
        .Sortable()
        .Scrollable()
        .DataSource(datasource => datasource
            .Ajax()
            .PageSize(20)
            .Events(events => events.Error("error_handler"))
            .Model(model => model.Id(c => c.InventorySeq))
            .Read(read => read.Action("GetCellInventory", "CellInventory").Data("_gridCellInventoryParameters"))    
            .Update(update => update.Action("UpdateCellInventory", "CellInventory")) 
        )   
    )

    UpdateCellInventory in Controller:

    [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult UpdateCellInventory([DataSourceRequest] DataSourceRequest request, EntInventory inventory)
    {
        if (inventory != null && ModelState.IsValid)
        {
            _margoRepository.UpdateInventory(inventory);
     
        }
     
        return Json(ModelState.ToDataSourceResult());
    }

    Thanks,

    Jerry



  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2306 posts

    Posted 10 Apr 2013 Link to this post

    Hi Jerry,


    Sorry for the inconvenience. The reason for this problem is a breaking change in jQuery 1.9 . Please take a look at the following forum thread, which demonstrates how to resolve the issue.

     

    Regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top