-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cdk/table) add directive to enable recycle view repeater #21508
feat(cdk/table) add directive to enable recycle view repeater #21508
Conversation
c555c3b
to
8e8f7fe
Compare
c0af9f7
to
e81b022
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just a couple small nits
table { | ||
width: 100%; | ||
} | ||
|
||
th { | ||
text-align: left; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add CSS classes to the example like .example-table
and .example-row
and use those here? I like to make it unambiguously clear where each styles comes from in examples so that anyone inspecting the example can quickly distinguish between example styles and component styles.
(similar for other examples)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Updated here and in the mat table demo.
src/cdk/table/table.ts
Outdated
* tables that animate rows. | ||
*/ | ||
@Directive({ | ||
selector: 'cdk-table[cdkRecycleRows], table[cdk-table][cdkRecycleRows]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selector: 'cdk-table[cdkRecycleRows], table[cdk-table][cdkRecycleRows]', | |
selector: 'cdk-table[recycleRows], table[cdk-table][recycleRows]', |
I would do just recycleRows
since we're conceptually pretending that this is an option on CdkTable
, the properties of which wouldn't be prefixed. Same for the mat
version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Updated here and in the mat table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Should there be changes to the documentation that explains these "inputs"?
d5a6ed1
to
bab9edd
Compare
bab9edd
to
46c9e7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@MichaelJamesParsons would you be willing to send a follow-up PR with docs? (just adding a brief section to table.md
)
@jelbourn yes, I'll prepare a PR for the docs this week. |
Documented in #21926 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The CDK and Material tables use the dispose view repeater strategy, which creates new rows from scratch when the dataset changes. This PR adds directives that enable the recycle view repeater, which caches disposed rows and reuses them when the dataset changes. This strategy reduces rendering latency for most tables, but may not be compatible with tables that animate rows.