When I create new record in grid and after that I delete that row, delete action method is not requested by client side as I see in firebug and Delete action doesnt fire. What should I do with this?
My grid:
<code>
@(Html.Kendo().Grid<TelerikMvcApp2.Models.Car>()
.Name("grid")
.Columns(c=>
{
c.Bound(x=>x.Name);
c.Bound(x=>x.Model);
c.Bound(x => x.YearOfProduction);
c.Bound(x => x.Cena);
c.Command(cmd => cmd.Edit());
c.Command(cmd => cmd.Destroy());
})
.ToolBar(toolbar=>toolbar.Create())
.Sortable()
.Editable(e=>e.Mode(GridEditMode.PopUp))
.Filterable()
.DataSource(d=>d
.Ajax()
.Model(m=>m.Id(p=>p.Id))
.Read("GetCars","Home")
.Destroy("Delete","Home")
.Create("Create","Home")
.Update("UpdateCar","Home")
)
)
</code>
My delete Action:
<code>
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Delete([DataSourceRequest] DataSourceRequest request, Car car)
{
return Json(new[] { car }.ToDataSourceResult(request, ModelState));
}
</code>
My grid:
<code>
@(Html.Kendo().Grid<TelerikMvcApp2.Models.Car>()
.Name("grid")
.Columns(c=>
{
c.Bound(x=>x.Name);
c.Bound(x=>x.Model);
c.Bound(x => x.YearOfProduction);
c.Bound(x => x.Cena);
c.Command(cmd => cmd.Edit());
c.Command(cmd => cmd.Destroy());
})
.ToolBar(toolbar=>toolbar.Create())
.Sortable()
.Editable(e=>e.Mode(GridEditMode.PopUp))
.Filterable()
.DataSource(d=>d
.Ajax()
.Model(m=>m.Id(p=>p.Id))
.Read("GetCars","Home")
.Destroy("Delete","Home")
.Create("Create","Home")
.Update("UpdateCar","Home")
)
)
</code>
My delete Action:
<code>
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Delete([DataSourceRequest] DataSourceRequest request, Car car)
{
return Json(new[] { car }.ToDataSourceResult(request, ModelState));
}
</code>