2

In Angulars ngFor you can use trackBy to pass a key so that Angular doesn't reload everything but only the items really needed.

Does the kendo-grid also function that way and if not by default, is it possible to pass a key to it, too?

Christian
  • 22,585
  • 9
  • 80
  • 106
  • Just FYI: If you own a commercial-license you do have access to the [Source Code](https://www.telerik.com/kendo-angular-ui/components/installation/source-code/). – Philipp Jul 12 '18 at 06:20
  • @Philipp Sadly I‘ve only access to the minified version currently in my project. – Christian Jul 12 '18 at 06:21

1 Answers1

0

Yes, here is the documentation link: https://www.telerik.com/kendo-angular-ui/components/grid/api/GridComponent/#toc-trackby

A quick example would be something like this:

<!-- template -->
<kendo-grid 
    [kendoGridBinding]="taskData"
    [trackBy]="trackById">

trackById(index: number, item: GridItem) {
  const dataItem = item.data as TaskItem;
  return dataItem.id;
}
Sean Chase
  • 1,139
  • 1
  • 15
  • 23