0

Question1

Is it possible to add null/undefined check for field type ? As type may be null for some data ?

 <p-treeTable [value]="files">
    <p-column field="name" header="Name"></p-column>
    <p-column field="size" header="Size"></p-column>
    <p-column field="type" header="Type"></p-column>
 </p-treeTable>

Will some thing like below should work ? Is there any way ?

     <ng-template*ngIf="type; else empyType">
       <p-column field="type" header="Type"></p-column>
     </ng-template>

     <ng-template #empyType>
       <p-column field="" header="Type"></p-column>
     </ng-template>

Question 2

How to add scrollbar in case of treetable overflows ? I tried adding CSS to ui-treetable-tablewrapper as overflow:scroll ?

Antikhippe
  • 6,316
  • 2
  • 28
  • 43
PPB
  • 287
  • 3
  • 7
  • 19
  • https://github.com/primefaces/primeng/issues/4813 this says Prime-Ng 6 is coming in April 18. which may have scroll-able treatable! waiting till then. – PPB Mar 27 '18 at 08:55
  • Why do you need to do that ? If `type` is null or empty for a given file, you won't have any data in *Type* column for the corresponding row... – Antikhippe Mar 27 '18 at 10:33
  • Yes exactly ! it should show empty cell for that particular column in a row. But it is giving error as type is undefined – PPB Mar 27 '18 at 11:13
  • Can you please share the output of your data assigned to `files` array ? – Antikhippe Mar 27 '18 at 12:47

0 Answers0