I am unable to retrieve routerLink in onNodeSelected.How can I pass custom data ?Hereis the result of the console log.
- nodeData:
- expanded: false
- hasChildren: false
- id: "01"
- isChecked: null
- parentID: null
- selectable: true
- selected: true
- text: "Estimation"
public data:{[key:string]:Object}[]=[
{
nodeId:'01', nodeText:'Estimation', iconCss:'e-icons e-list-ordered', routerLink:'/estimations'
}
];
public fields:object={ dataSource:this.data, id:'nodeId', text:'nodeText', iconCss:"iconCss"};
async onNodeSelected(args: any):Promise<void>{
console.log(args);
const selectedNode = args?.nodeData;
const routerLink = selectedNode?.routerLink;
if(!routerLink){
return;
}
await this.router.navigate([routerLink]);
}