Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Kendo Grid Field Name gives a warning "Grid Field name is not a valid identifier"

here is the exact warning which I am getting

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.

and here is the code which i have written for the kendo grid to dynamicall get the names

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

how can we tackle those warning?

like image 501
Onkar Nirhali Avatar asked Jan 18 '26 06:01

Onkar Nirhali


1 Answers

So the mistake in this code I had noticed was that instead of field I should have written Title and instead of title I should have written name.

So below is my solution which worked and I didn't have any warning in the console.

 <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>
like image 172
Onkar Nirhali Avatar answered Jan 19 '26 19:01

Onkar Nirhali



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!