I am having trouble accessing hidden fields when crafting an anchor tag with a routerLink directive within an igx-grid field template. I'd like to get the current cell, then row and then a specific hidden cell in that row to craft the link queryParams. Specifically, I need to replace <<id>> in the code below.
<igx-grid #grid [data]="mydata" [primaryKey]="'id'" [autoGenerate]='false'> <igx-column field="id" header="ID" hidden="true" ></igx-column> <igx-column field="name" header="Name" sortable="true" > <ng-template igxCell let-cell="cell"> <a [routerLink]="['/myroute', <<id>>]">{{ cell.value }}</a> </ng-template> </igx-column> </igx-grid>
looks like I am able to access more data in the component typescript file.
Hello, Thank you for contacting us.
Is the described approach be able to solve your problem and do you have any additional questions? Also you can always use directly your data source and extract any value you need. Another thing you can keep in mind that each cell has a cellID which gives you the columnID, rowID and the rowIndex, which will help you to access a specific row or column form the grid (here you can see the grid API).If you need any further assistance, please contact us.