【问题标题】:Angular Kendo Grid Field Name gives a warning "Grid Field name is not a valid identifier"Angular Kendo 网格字段名称给出警告“网格字段名称不是有效标识符”
【发布时间】:2020-06-15 11:57:51
【问题描述】:

这是我得到的确切警告

Grid column field name 'Access Request Privilege' does not look like a valid JavaScript identifier.
                Identifiers can contain only alphanumeric characters (including "$" or "_"), and may not start with a digit.
                Please use only valid identifier names to ensure error-free operation.

这是我为剑道网格编写的用于动态获取名称的代码

<kendo-grid-column field="{{gridColumn2}}" title="Access Request Privilege" width="110">
        <ng-template kendoGridCellTemplate let-dataItem>
          <div [innerHTML]="dataItem.AccessPrivilegeName"></div>
        </ng-template>
  </kendo-grid-column>

我们如何处理这些警告?

【问题讨论】:

    标签: angular kendo-ui kendo-grid kendo-ui-angular2


    【解决方案1】:

    所以我注意到这段代码中的错误是我应该写标题而不是字段,而不是标题我应该写名称。

    所以下面是我的解决方案,我在控制台中没有任何警告。

     <kendo-grid-column title="{{gridColumn2}}" name="Access Request Privilege" width="110">
               <ng-template kendoGridCellTemplate let-dataItem>
                   <div [innerHTML]="dataItem.AccessPrivilegeName"></div>
               </ng-template>
        </kendo-grid-column>
    

    【讨论】:

      猜你喜欢
      • 2019-04-07
      • 2023-03-23
      • 2010-09-12
      • 2018-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多