-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(datagrid): add workaround to enable
clrDgSelectable
with *ngFor
It is impossible (or very difficult) to grab the correct `trackBy` function via the row iterator structural directive. The `ngForTrackBy` directive would grab the `trackBy` function from any `*ngFor` in the datagrid, not just the row iterator. Further, needing the item index to track selection introduces a race condition when `*ngFor` is used. We don't have the collection of items when the rows inputs are set, so `clrDgSelectable` doesn't work. The fix is to pass a "track by" function directly to the datagrid. This change introduces a `clrDgItemsTrackBy` input that will used if provided. Otherwise, the datagrid will fall back to the previous behavior of trying to grab the `trackBy` function from the row iterator structural directive. The fallback behavior is deprecated and scheduled for removal in v17. This is a backport of 8fe236a to 13.x. closes #157
- Loading branch information
1 parent
a84ce08
commit ccda8c1
Showing
12 changed files
with
599 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.