[英]Grid in Kendo UI MVC cannot edit
我使用Kendo UI MVC創建了一個Grid
來管理Admin用戶的數據庫。 昨天它可以編輯,但是現在我無法編輯或單擊Grid
任何按鈕。 我不知道他們怎么了? 有人知道這種情況的解決方案嗎?
.cshtml
:
@using AdventureCycle.Models
@model IEnumerable<SubCateViewModel>
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(c => c.ProductSubcategoryID).Width(140);
columns.Bound(c => c.ProductCategoryID).Width(140);
columns.Bound(c => c.NameofBike).Width(190);
columns.Bound(c => c.Name).Width(190);
columns.Template(c => { }).ClientTemplate("<a href='" + Url.Action("", "StoreManager") + "/#= ID #'" + "><img src='../GetImage.ashx?ID=@bike.ProductProductPhotoes.FirstOrDefault().ProductPhotoID' /></a>").Width(150).Title("Picture");
columns.Bound(c => c.isSelected).Width(120);
})
.Editable(edit => edit.Mode(GridEditMode.InCell))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.Sortable()
.Groupable()
.ToolBar(tb =>
{
tb.Create();
tb.Save();
})
.Filterable()
.DataSource(datasource => datasource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Model(model => model.Id(c => c.ProductID))
.Read("GetSub","Grid")
.Update("UpdateSub","Grid")
.Create("InsertSub","Grid")
.Destroy("DeleteSub","Grid"))
)
看起來是服務器操作為假,這是導致問題的原因,如果不是的話
嘗試在更新和編輯命令中使用Lambda表達式
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Orders_Read", "Orders"))
.Update(update => update.Action("Orders_Update", "Orders"))
.Destroy(update => update.Action("Orders_Delete", "Orders"))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.