Issue with persist columns demo

0 Answers 46 Views
Grid
Domamu
Top achievements
Rank 1
Domamu asked on 02 Mar 2023, 08:18 PM

Hi,

  I am trying the code for persist columns on my computer.  I got the code from this URL:

    https://www.telerik.com/kendo-angular-ui/components/knowledge-base/persist-columns-order/

  I received the error below when I tried to run the code:

Error: src/app/app.component.ts:52:16 - error TS7053: Element implicitly has an 'any' type because expression of type '"field"' can't be used to index type 'ColumnBase'.
  Property 'field' does not exist on type 'ColumnBase'.

52         field: col["field"],
                  ~~~~~~~~~~~~

  The corresponding code is this:


//the restructured columns containing only the needed properties that will be persisted
    const restructuredColumns: ColumnFooType[] = orderedColumns.map(col => {
      const column: ColumnFooType = {
        field: col["field"],
        title: col["title"]
      };
      return column;
    });

  It looks like there is no "field" property in ColumnBase.  Does anyone know how to fix the error?

Thanks,

Taichi

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Domamu
Top achievements
Rank 1
Share this question
or