TreeGrid Template Column

Hello Team,

On Tree-Grid version 18.1.43 I get column property in data in <ng-template>

Below is example which I used.

<ng-template #templateIconText let-data>
    <span class="font-weight-bold">
        <i *ngIf="data.column.field+'_ICON'" [style.font-size.px]="16"
            [ngClass]="storageService.getClassName('icon',data[data.column.field+'_ICON'])">]
</i>&nbsp;{{data[data.column.field]}}</span>
</ng-template>


But when I updated tree-grid to latest version than column property not exist in data. So please help me how manage this problem.




2 Replies

JR Jagadesh Ram Raajkumar Syncfusion Team July 16, 2021 03:09 AM UTC

Hi Nagendra, 


Greetings from Syncfusion Support. 

Query: column property not exist in data. 
 
 
We have analyzed your code snippet and we can replicate the issue and we need time to validate the issue. So we will provide further details on 7/19/2021. Until then we value your patience. 


Regards,
Jagadesh Ram 



JR Jagadesh Ram Raajkumar Syncfusion Team July 16, 2021 10:56 AM UTC

Hi Nagendra, 
Thanks for your patience. 

On further analysis, we found that the issue may occur if the field for the column is not defined, So we recommend you to ensure whether the field property is set correctly or not for the column.   
We have prepared a sample using the column object from the data inside the ng-template for your reference. 

Please refer the below link for sample:
https://stackblitz.com/edit/angular-f167215?file=app.component.html

Kindly get back to us for further assistance.


Regards,
Jagadesh Ram 


Loader.
Up arrow icon