kendo-ui - 剑道 Telerik TagHelper
问题描述
我在 asp 核心中使用了 kendo Telerik,并在 Html Helpers 中使用了它。但现在我要使用标签助手。谁知道用 TagHelpers 替换我的代码:
HTML 助手:
@model IEnumerable<Lms.Domain.Models.Group>
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.Id);
columns.Bound(c => c.GroupName);
columns.Bound(c => c.LibraryId);
columns.Command(command => { command.Edit(); command.Destroy()});
})
.Pageable()
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.ServerOperation(false)
.Model(M=>M.Id(c=>c.Id))
.Read(read=>read.Action("GroupView","Group"))
)
);
实际上标签助手中的数据绑定有问题吗?
解决方案
请参阅下面的代码
<kendo-grid name="grdName" height="550">
<columns>
<column field="Id" hidden="true"/>
<column field="GroupName" title="Group Name" />
<column field="LibraryId" title="Library Id" />
<column width="100" title="View/Edit">
<commands>
<column-command name="custom" text="<span
class='fa-1x fa fa-edit' style='color:blue'>
</span>" click="view"></column-command>
</commands>
</column>
</columns>
<toolbar>
<toolbar-button name="custom" template="addNewTemplate">
</toolbar-button>
</toolbar>
<scrollable enabled="true" />
<sortable enabled="true" />
<pageable enabled="true" />
<filterable enabled="true" />
<datasource type="DataSourceTagHelperType.Ajax">
<transport>
<read url="@Url.Action("GetList", Controller)"/>
</transport>
</datasource>
</kendo-grid>
推荐阅读
- c++ - 如何在 c++ 中为 QSortFilterProxyModel 定义函数“过滤器”?
- vba - excel VBA中的错误“ODBC驱动程序不支持请求的属性”
- python - 如何改进networkx杠铃图的布局?
- python - 变分自动编码器(keras)中的新错误
- spring - 卡蒙达。从委托代码访问变量
- java - 如何在 android 的数组 Cloud firestore 中附加一个元素?
- html - 注册中的输入字段在我注销后不可编辑,但在 angularJS 中刷新后可编辑
- java - 延迟获取具有多个关系的实体:无法编写 JSON:无法延迟初始化角色集合
- ios - 如何使用生物识别/kSecAttrAccessControl 保护 SecIdentity?
- css - 如何“清除”形状外部元素,使其不会影响下面的元素