-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add extensible table row detail feature #24636
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
Conversation
Introduces the ExtensibleTableRowDetailComponent for expandable row details in extensible tables. Updates the extensible table to support row detail templates via both direct input and content child component, adds toggle logic and emits rowDetailToggle events. Documentation and exports are updated accordingly.
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.
Pull request overview
This pull request introduces an expandable row detail feature for the ExtensibleTableComponent in ABP Framework's Angular UI. It enables users to click an expand/collapse chevron icon to reveal additional content below each table row.
Changes:
- Adds new
ExtensibleTableRowDetailComponentto encapsulate row detail templates - Extends
ExtensibleTableComponentwith row detail inputs, outputs, and toggle functionality - Updates template to include row detail rendering with ngx-datatable-row-detail
- Provides comprehensive documentation with usage examples
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| extensible-table-row-detail.component.ts | New component to define row detail templates with configurable height |
| extensible-table-row-detail/index.ts | Barrel export for the new row detail component |
| extensible-table.component.ts | Adds row detail support with inputs, outputs, ViewChild reference, and toggle method |
| extensible-table.component.html | Integrates row detail template rendering and expand/collapse column |
| index.ts (components) | Exports the new row detail component |
| public-api.ts | Exposes the row detail component in public API |
| extensible-table-row-detail.md | Comprehensive documentation with API reference and usage examples |
...ages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts
Outdated
Show resolved
Hide resolved
...ages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts
Outdated
Show resolved
Hide resolved
| styles: [` | ||
| :host ::ng-deep .ngx-datatable.material .datatable-body .datatable-row-detail { | ||
| background: none; | ||
| padding: 0; | ||
| } | ||
| `], |
Copilot
AI
Jan 12, 2026
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.
The inline styles use :host ::ng-deep which is a deprecated Angular feature. The ::ng-deep combinator is deprecated and may be removed in future Angular versions. Consider using ViewEncapsulation.None if you need to style child component elements, or apply these styles at a global level in your theme. If these styles must remain component-scoped, document that this is a temporary solution pending a better approach.
| get effectiveRowDetailTemplate(): TemplateRef<any> | undefined { | ||
| return this.rowDetailComponent?.template() ?? this.rowDetailTemplate; | ||
| } | ||
|
|
||
| /** Gets the effective row detail height */ | ||
| get effectiveRowDetailHeight(): string | number { | ||
| return this.rowDetailComponent?.rowHeight() ?? this.rowDetailHeight; | ||
| } |
Copilot
AI
Jan 12, 2026
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.
According to ABP Framework guidelines, public and protected members should be virtual to support extensibility and allow inheritance-based customization. The getters effectiveRowDetailTemplate and effectiveRowDetailHeight should be marked as virtual to allow derived classes to override this behavior.
| <img alt="Extensible Table Row Detail Example" src="./images/extensible-table-row-detail-example.png" width="800px" style="max-width:100%"> | ||
|
|
Copilot
AI
Jan 12, 2026
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.
The documentation references an image file "./images/extensible-table-row-detail-example.png" that is not included in this pull request. This will result in a broken image in the documentation. The image file should be added to the appropriate location or the image reference should be removed until the image is available.
| <img alt="Extensible Table Row Detail Example" src="./images/extensible-table-row-detail-example.png" width="800px" style="max-width:100%"> |
| @Input() tableHeight: number; | ||
|
|
||
| // Row detail configuration (supports both direct template and child component) | ||
| @Input() rowDetailTemplate?: TemplateRef<{ row: R; expanded: boolean }>; |
Copilot
AI
Jan 12, 2026
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.
The template context type in rowDetailTemplate uses an inline type definition. For better type safety and reusability, consider defining a separate interface or type alias for the row detail template context, such as 'RowDetailContext' or 'ExtensibleTableRowDetailContext'. This would improve code maintainability and allow consumers to import and use the type definition.
| // Row detail configuration (supports both direct template and child component) | ||
| @Input() rowDetailTemplate?: TemplateRef<{ row: R; expanded: boolean }>; | ||
| @Input() rowDetailHeight: string | number = '100%'; | ||
| @Output() rowDetailToggle = new EventEmitter<R>(); |
Copilot
AI
Jan 12, 2026
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.
The comment on line 139 states "supports both direct template and child component", but it would be clearer to specify that when both are provided, the child component takes precedence (as implemented in the effectiveRowDetailTemplate getter). This should be documented in the JSDoc comment or in the component documentation to help users understand the precedence order.
| toggleExpandRow(row: R): void { | ||
| this.table?.rowDetail?.toggleExpandRow(row); | ||
| this.rowDetailToggle.emit(row); | ||
| } |
Copilot
AI
Jan 12, 2026
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.
According to ABP Framework guidelines, all public methods should be virtual to support extensibility. The toggleExpandRow method should be marked as virtual to allow derived classes to customize the expand/collapse behavior.
...es/components/extensible/src/lib/components/extensible-table/extensible-table.component.html
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,10 @@ | |||
| import { Component, contentChild, input, TemplateRef } from '@angular/core'; | |||
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.
Since we still support the module usage in the packages, it is better to import this component ExtensibleTableRowDetailComponent in extensible module.
| <ngx-datatable-column [width]="50" [resizeable]="false" [sortable]="false" [draggable]="false" | ||
| [canAutoResize]="false"> | ||
| <ng-template let-row="row" let-expanded="expanded" ngx-datatable-cell-template> | ||
| <a href="javascript:void(0)" class="text-decoration-none text-muted" |
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.
We can use href="#" with (click)="toggleExpandRow(row); $event.preventDefault()" or better yet, use a <button> element styled as a link for better accessibility and security.
| ```json | ||
| //[doc-seo] | ||
| { | ||
| "Description": "Learn how to add expandable row details to data tables using the Extensible Table Row Detail component in ABP Framework Angular UI." |
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.
This document is not referenced in another one, so we can make a reference here to make it visible.
sumeyyeKurtulus
left a comment
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.
Hello @fahrigedik thank you for adding such update. Other than my comments and some of the notes provided by the co-pilot, this PR is mergable.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/extensible-table/extensible-table.component.html Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ertion (!) but doesn't specify the static option Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Registered ExtensibleTableRowDetailComponent in ExtensibleModule and updated documentation to reference the new row detail feature. Also improved accessibility and semantics by replacing the expand/collapse anchor with a button in the extensible table component template.
|
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 73.4%, saving 23.0 KB.
|
Introduced a RowDetailContext interface for row detail templates to improve type safety and clarity. Updated rowDetailTemplate and related methods to use the new context type. Also added documentation regarding deprecated ::ng-deep usage in styles.
|
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 7.8%, saving 670 B.
|
|
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 7.1%, saving 557 B.
|
Description
Introduces the ExtensibleTableRowDetailComponent for expandable row details in extensible tables. Updates the extensible table to support row detail templates via both direct input and content child component, adds toggle logic and emits rowDetailToggle events. Documentation and exports are updated accordingly.
Resolves #24635 (write the related issue number if available)
TODO: Describe what this PR has changed, add screenshot or animated GIF if available, write if it is a breaking change, and how to fix the breaking changes for existing applications if so.
Checklist
How to test it?
you have to change branch issue-24635-test on abp
you have to run dev-app on abp repository.
you have to open tenants page and open row-detail.