0
votes

I have the next Kendo Grid, all the events in the models take place, no problem!.

The problem is when I change a value in the grid, it not refresh again.

How I can fix this, or how I can get the event occurring when I do changes on the grid, to manage the grid refresh with JQuery.

@(Html.Kendo().Grid<Corporativo.Model.SolProdVM>()
                    .Name("SolicitudesProducto")
                    .Columns(columns =>
                    {
                        columns.Bound(e => e.Id_Producto).Width(80).Title("Código");
                        columns.Bound(e => e.DescProducto).Width(40).Groupable(false).Title("Producto");
                        columns.Bound(e => e.UM).Width(40).Groupable(false).Title("UM");
                        columns.Bound(e => e.Precio).Width(40).Groupable(false).Title("Precio");
                        columns.Bound(e => e.Cantidad).Width(40).Groupable(false).Title("Cantidad");
                        columns.Bound(e => e.Importe).Width(40).Groupable(false).Title("Importe");
                        columns.Command(command => command.Custom("Eliminar").Click("elimar_de_solicitud")).Width(25);
                    })
                    .Sortable()
                    .ToolBar(toolBar =>
                    {
                        toolBar.Save().Text("Guardar cambios");
                    })
                    .Editable(editable => editable.Mode(GridEditMode.InCell))
                    .Filterable()
                    .Pageable()
                    .Scrollable()                    
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .PageSize(5)
                        .Model(model => {
                            model.Id(p => p.Id_Solicitud);
                            model.Id(p => p.Id_Producto);
                            model.Field(p => p.Desc_Producto).Editable(false);
                            model.Field(p => p.UM).Editable(false);
                            model.Field(p => p.Precio).Editable(false);
                            model.Field(p => p.Cantidad);
                            model.Field(p => p.Importe).Editable(false);       

                        })
                        .Read(read => read.Action("GetAllSolProdJSON", "ProductRequest", new { Id_Solicitud = @Model.Id_Solicitud }))
                        .Update(update => update.Action("ActualizarSolProd", "ProductRequest").Type(HttpVerbs.Post))
                        .Destroy(destroy => destroy.Action("EliminarSolProd", "ProductRequest").Type(HttpVerbs.Post))                        
                    )
                )
1

1 Answers

0
votes

There is an Events Method you can call.

@(Html.Kendo().Grid<Model_MVC.Models.OrderGridViewModel>()
.Name("ProposalGrid")
 .HtmlAttributes(new { style = "font-size:14px;line-height:2em;width:80%;margin-left:190px;" })    
.Columns(columns =>
{
     //columns
})
  .
    .DataSource(dataSource => dataSource
    .Ajax() 
      .Read(read => read.Action("Orders_Read", "Orders"))
      .Events(x => x.Change("JSFunction") )          
      .Model(model =>
          {
              model.Id(i => i.OrderId);
              model.Field(x => x.OrderId).Editable(false);
          })
      .PageSize(15)
   )       
   .Pageable()
)