Treetable - Unable to get emptymessage template to show on expand

UI Components for Angular
Post Reply
craig2005
Posts: 2
Joined: 22 Aug 2018, 17:08

22 Aug 2018, 17:36

For the treetable, i'm unable to get the emptymessage to appear on drill downs. I couldn't find any examples on the website either.

When you have a dynamic request (XHR) on expanding a tree table row, does anyone know how to get the no data template to show up under the parent row? I'm setting hasData to false which should trigger the ng-template. Is that template not for drill downs?

Code: Select all

<ng-template *ngIf="!hasData" pTemplate="emptymessage" let-columns>
    <tr>
        <td [attr.colspan]="cols.length">
            No records found
        </td>
    </tr>
</ng-template>
PrimeNG 6.1 and Angular 6

pushkar
Posts: 2
Joined: 31 Aug 2018, 20:54

11 Sep 2018, 23:33

Please remove *ngIf="!hasData" from below code.

The below code is working without any if condition. You will defect automatic if no result found in treenode array.

Code: Select all

 <ng-template pTemplate="emptymessage" let-columns>
          <tr>
              <td [attr.colspan]="columns.length">
                  No records found
              </td>
          </tr>
      </ng-template>
Just try to return null from the function where you bind resultset to treenode and see whether above code works or not.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests