Jak odświeżyć siatkę Kendo UI
Próbuję odświeżyć siatkę Kendo UI, ale jeszcze nie udało się. Czy ktoś mógłby doradzić, co przegapiłem lub co zrobiłem źle?
Mam następujący kod:
.cshtml:
$('#btnRefresh').click(function (e){
$.ajax({
type: 'POST',
url: "@(Url.Content("~/Administration/RefreshAll/"))",
success: function () {
$("#Product").data("kendoGrid").dataSource.read();
$('#Product').data('kendoGrid').refresh();
//grid.refresh();
location.reload(true);
},
error: function (){
$("#btnRefresh").removeAttr('disabled');
}
});
});
Kontroler:
public ActionResult RefreshAll([DataSourceRequest] DataSourceRequest request)
{
db.ProcessAll();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
return View();
}