15
我想刷新Kendo UI網格,但尚未成功。有人會建議我錯過了什麼或者我做錯了什麼嗎?如何刷新Kendo UI網格
我有以下代碼:
.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');
}
});
});
控制器:
public ActionResult RefreshAll([DataSourceRequest] DataSourceRequest request)
{
db.ProcessAll();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
return View();
}
public void ProcessAll()因此我無法返回JSON – Spidey 2013-05-09 21:49:50
您需要將列表對象傳遞給模型。 – HaBo 2013-05-09 22:22:11
好的。謝謝我將嘗試 – Spidey 2013-05-09 22:25:17