Recursive Code for TreeGrid Tooltip

I've got a treegrid with tooltips using the standard setup.

It shows the mousecontent for the parents via:

onBeforeRender(args) {

      let myData = this.requirements.find(x => x.name === args.target.innerText);

      this.mousecontent = myData.requirementDetail;

    }

It cannot find the data for the children because the data for those lines are actually in the subitems.
myArray[i].subitems[j].name and that code wouldn't find it.

Does anyone have any code laying around that would search that array recursively?

It's 

Thanks



Attachment: Requirements_Subitems_9a56ae96.zip

3 Replies 1 reply marked as answer

PS Pon Selva Jeganathan Syncfusion Team October 15, 2021 01:08 PM UTC

Hi Walter,   
 
Thanks for contacting syncfusion forum. 
 
Query: Does anyone have any code laying around that would search that array recursively? 

Based on your query, we suspect that you want to display the tooltip for tree grid child items. We have already discussed same in the below help documentation,

Please refer to the below help documentation:

https://ej2.syncfusion.com/angular/documentation/treegrid/how-to/custom-tool-tip-for-columns/

Please refer to the below sample:

https://ej2.syncfusion.com/angular/documentation/treegrid/how-to/custom-tool-tip-for-columns/

If the above solution does not meet your requirement, kindly get back to us with the below requested details, 
 
  1. Please share the detail explanation of your requirement.
  2. Provide a simple sample code to define your requirement.
  3. Share us a video demo or screenshot of your requirement.
 
The provided information will be helpful to provide you response as early as possible.   

Regards,  
Pon selva   



Marked as answer

WC Walter Cook October 15, 2021 02:02 PM UTC

Aha. Different approach than I'd been using.

A little tweak

content: args.data.myDataField.toString()

Got me there.


Thanks!




MP Manivannan Padmanaban Syncfusion Team October 18, 2021 06:36 AM UTC

Hi Walter, 

Thank you for the update. 

Please get back to us, if you need further assistance. We will be happy to assist you. 

Regards, 
Manivannan Padmanaban 


Loader.
Up arrow icon