Angular kendo-grid persist state for columns with field and title translate pipe and ng-templates.

0 Answers 63 Views
Grid
Domamu
Top achievements
Rank 1
Domamu asked on 01 Mar 2023, 05:13 PM

Hi,

  I checked the demo for Angular kendo-grid persist state at this url: https://www.telerik.com/kendo-angular-ui/components/grid/persist-state/

  The demo is good and it works for simple columns, because it's using *ngFor to generate columns in the grid.

  Is it possible to have persist state for grid with custom columns?  For example, I have following columns in my grid:

<kendo-grid-column field="{{ 'category.field' | translate }}" title="{{ 'grid.category' | translate }}" [width]="150">
  <ng-template kendoGridCellTemplate let-dataItem>
	<span *ngIf="dataItem.category.id === CATEGORY.LIVINGROOM">
		Some custom code here

	</span>
	<span *ngIf="dataItem.category.id !== CATEGORY.LIVINGROOM">
		Some cusotm code here
	</span>
  </ng-template>
</kendo-grid-column>

<kendo-grid-column field="{{ 'subCategory.field' | translate }}" title="{{ 'grid.subCaregory' | translate }}" [width]="150">
  <ng-template kendoGridCellTemplate let-dataItem>
	<span *ngIf="dataItem.subCategory.id === SUBCAREGORY.SOFA">
		Some custom code here

	</span>
	<span *ngIf="dataItem.subCategory.id !== SUBCAREGORY.SOFA">
		Some cusotm code here
	</span>
  </ng-template>
</kendo-grid-column>

  If there is a way to use persist state for grid with custom columns, can you provide some code sample?

Thanks,

Taichi

 

 

 

No answers yet. Maybe you can help?

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