Hi,
I am following the example here: https://www.telerik.com/kendo-angular-ui/components/grid/how-to/persist-state/
First of all the hidden is missing from column-settings.interface.ts.
Since I wanted to use more attributes like we can do when using kendo-grid-column I changed the columnsConfig: ColumnSettings[]; to columnsConfig: any[]; into grid-settings.interface.ts
I have severl date fields coming from my response in the following format: 2020-06-22T00:00:00
When I was using the HTML and kendo-grid-column with the following example I could get them formatted as I wanted:
<kendo-grid-column
field="startDate"
title="Start Date"
[width]="120"
filter="date"
[hidden] = "true">
<ng-template kendoGridCellTemplate let-dataItem>
{{dataItem.startDate | date: 'dd/MM/yyyy'}}
</ng-template>
</kendo-grid-column>
Now that I had to move the logic into the component to be able to have persistent grids I am trying several format, but none seems to work:
columnsConfig: [{
field: 'startDate',
title: 'Start Date',
filterable: true,
filter: 'date',
format: '{0:d}',
hidden: true,
width: 120
} ]
And secondary how can I also add an action column in the begining of my grid with view, edit, delete icons as I did before in the html with the following code:
<kendo-grid-column field="{{'common.actions' | translate}}" width="120">
<ng-template kendoGridCellTemplate let-project let-isNew="isNew">
<div class="action-buttons">
<button title="{{'common.displayInfo' | translate}}"><i class="fa fa-info"></i></button>
<button routerLink="/project/{{project.id}}/view"><i class="fa fa-search"></i></button>
<button kendoGridEditCommand><i class="fa fa-pencil"></i></button>
<button kendoGridRemoveCommand><i class="fa fa-trash"></i></button>
</div>
</ng-template>
</kendo-grid-column>
How can I write the same in my component!?!? I tried using template there without any luck.
Thank you.