angularignite-ui-angularigx-grid

error message when trying to update date inline edit with igx-grid


I am getting an

"ERROR TypeError: value.toLocaleDateString is not a function"

when I double click to do inline edit. An example on

https://stackblitz.com/github/IgniteUI/igniteui-live-editing-samples/tree/master/angular-demos/grid/grid-add-row?file=package.json

inline edit works but I am using cellTemplate where I have to add a template to do what seems to be built-in. I see a calendar control when I double click on the date column but I can't edit because of the error.

<igx-column *ngFor="let column of columns" [editable]=true>
  <ng-template #cellTemplate igxCell *ngSwitchCase="'date'" let-cell="cell" let-value>
    {{dateColumn(value, column.format)}}
  </ng-template>
  <ng-template igxCellEditor *ngSwitchCase="'date'" let-cell="cell" let-val>
    <igx-date-picker [(ngModel)]="cell.editValue ? cell.editValue : cell.value" mode="dropdown" [igxFocus]="true"
            [labelVisibility]="false" mask="dd/MM/yyyy" format="dd/MM/yyyy">
    </igx-date-picker>
  </ng-template>

Solution

  • Date needs to be an object not string