0
我無法在Kendo Grid Client模板中獲取RouteUrl值。見下文 代碼爲某種原因,它是顯示在同一頁面,而不是去調用房源詳細信息頁面與標識我無法在Kendo網格客戶端模板中獲取RouteUrl值。請參閱下面的代碼
@(Html.Kendo().Grid<SharedListingViewModel>()
.Name("listing-grid")
.Columns(columns =>
{
columns.Bound(x => x.Id)
.ClientTemplate("<a href='" + Url.RouteUrl("Listing", new { listingId = "#= Id #", SeName = "#= SeName #" }) + "'" + ">Show Details</a>");
);
columns.Command(command => { command.Destroy(); }).Width(160);
})
.Editable(x =>
{
x.Mode(Kendo.Mvc.UI.GridEditMode.InLine);
})
.Pageable()
.Sortable()
.Scrollable()
//.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(x => x.Id))
.Read(read => read.Action("FavoritesList", "MemberProfile"))
.Destroy(destroy => destroy.Action("FavoritesDelete", "MemberProfile"))
)
)
什麼是列模板生成的HTML輸出?查看源代碼並查找kendoGrid初始化腳本。 –