Skip to content

Conversation

@chintankavathia
Copy link
Member

fix DatatableComponent.trackByProp which always returned undefined on group level by using key as index for group.

BREAKING CHANGE: DatatableComponent.trackByProp input now enforce strict type check as key of row.

Before:

// Even though name is not a valid prop on rows it is allowed to be used with trackByProp.

<ngx-datatable
 trackByProp="'name'"
 [rows]="[{id: 1}, {id: 2}]"
>

After:
Typescript would give compilation error as name is not know property in rows.

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

What is the new behavior?

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@chintankavathia chintankavathia added the breaking-changes Marks issues and PRs that are breaking the API label Oct 17, 2025
@chintankavathia chintankavathia marked this pull request as ready for review November 3, 2025 05:15
@chintankavathia chintankavathia requested a review from a team as a code owner November 3, 2025 05:15
fix `DatatableComponent.trackByProp` which always returned undefined on group level by using key as index for group.

BREAKING CHANGE: `DatatableComponent.trackByProp` input now enforce strict type check as key of row.

Before:

// Even though name is not a valid prop on rows it is allowed to be used with `trackByProp`.

```
<ngx-datatable
 trackByProp="'name'"
 [rows]="[{id: 1}, {id: 2}]"
>
```
After:
Typescript would give compilation error as name is not known property in rows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-changes Marks issues and PRs that are breaking the API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant