【问题标题】:Kendo Telerik TagHelper剑道 Telerik TagHelper
【发布时间】:2020-04-08 18:09:32
【问题描述】:

我在 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-ui telerik kendo-grid telerik-grid


    【解决方案1】:

    看下面的代码

            <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>
    

    【讨论】:

      猜你喜欢
      • 2015-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多