Skip to content
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

I have a Parent Tree and a Children Tree and As I Can set headers for Parent Tree I need to set headers for children tree is there a possible way to do so? A sample of what i want is show as below using TreeTable #13762

Closed
palaksethi24 opened this issue Sep 27, 2023 · 3 comments
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request

Comments

@palaksethi24
Copy link

palaksethi24 commented Sep 27, 2023

Describe the feature you would like to see added

P-tree table
I have a Parent Tree and a Children Tree and As I Can set headers for Parent Tree I need to set headers for children tree is there a possible way to do so? A sample of what i want is show as below using TreeTable
desk

Typescript Code :-
this.reportService.getOverheadAuditReport(this.selectedScenario || "").subscribe(data => {
this.reportData = data.map((row: IOverheadAudit) => mapFlatDataForTreeTable(row))
});

		mapTreeDataForTreeTable(row: any, isLeaf: boolean): TreeNode {
    return {
        data: row,
        leaf: isLeaf
    }
}

HTML CODE :- 
 <p-treeTable [value]="reportData" [paginator]="true" [paginatorPosition]="'both'" 
                         [rows]="50" [rowsPerPageOptions]="rowOptions" **[columns]="selectedReportCols"**
                         [scrollable]="true" scrollHeight="400px" [resizableColumns]="true" [loading]="loading"
                         (onNodeExpand)="onNodeExpand($event)" 
                         columnResizeMode="expand" [reorderableColumns]="true" styleClass="table-bordered" #treeTable>
						 
						 
						    <ng-template pTemplate="header" let-columns>
                    <tr style="height: 55px;">
                        <th *ngFor="let col of columns" [ttSortableColumn]="col.field" ttResizableColumn ttReorderableColumn>
                            {{col.header}}
                            <p-treeTableSortIcon [field]="col.field"></p-treeTableSortIcon>
                        </th>
                    </tr>
					
					<ng-template pTemplate="body" let-rowNode let-rowData="rowData" let-columns="columns">
                    <tr style="height: 30px;">
                        <td *ngFor="let col of columns; let i = index" class="ca-overFlowHidden" title="{{rowData[col.field]}}">

                            <div *ngIf="!col.pipeCurrency && !col.pipeNumber && !col.pipeDollarOnly && !col.pipePercent && !col.pipeNumberOnly" [ngClass]="{'text-right':col.total,
                                                                    'text-left':!col.total}">
                                <p-treeTableToggler [rowNode]="rowNode"  *ngIf="i == 0" ></p-treeTableToggler>
                                {{rowData[col.field]}}
                            </div>
							</td>
							</tr>
							</ng-template>
                </ng-template>
						 
						 </p-treeTable>

Is your feature request related to a problem?

No response

Describe the solution you'd like

No response

Describe alternatives you have considered

No response

Additional context

No response

@palaksethi24 palaksethi24 added Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request labels Sep 27, 2023
@adri95cadiz
Copy link

I think you can use rowExpand feature of standard table component to achieve this.
https://primeng.org/table#row-expand

@SoyDiego
Copy link
Contributor

SoyDiego commented Sep 27, 2023

Maybe this type of questions you can do it in the Discussions Forums:
https://github.com/orgs/primefaces/discussions/categories/primeng

@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

4 participants