我有一个Kendo UI MVC Helper Grid与模板列有问题。我的问题是我不想使用服务器端调用进行过滤或排序。当我禁用服务器端数据源时,我的模板不会呈现“名称”列。这里是我的代码:Kendo UI MVC Grid - DataSource干扰列模板
@(Html.Kendo().Grid(Model.Contacts)
.Name("contactGrid")
.Columns(c =>
{
c.Bound(p => p.Name).Title("Contact Name").Template(@<text><a href="/contact-details/@item.Id" target="_blank">@item.Name</a></text>);
c.Bound(p => p.Id).Title("Unique ID");
})
.Sortable(s => s.SortMode(GridSortMode.SingleColumn).AllowUnsort(true))
.Scrollable(s => s.Height(430))
.Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s.Contains("Contains"))))
.DataSource(d => d.Ajax().ServerOperation(false))
)
如果我注释掉像这样的数据源:
//.DataSource(d => d.Ajax().ServerOperation(false))
则模板正常工作的“名称”一栏,但页并回发,这是为了电网的目的而过度杀伤。如果我不留下注释,那么“名称”列中的单元格都会呈现为纯文本(不存在锚定标记),但我有客户端排序和过滤。
我需要更改以允许“名称”列上的模板并进行客户端排序和过滤?