You need to sign in to do that
Don't have an account?

Lightning:TreeGrid
Hi ,
We have a requirement to Display Accounts, Contacts( of account), Opportunities(of contact) to be displayed in a tree hierarchy using lightning component.
I am not able to customize the code from below link https://developer.salesforce.com/docs/component-library/bundle/lightning:treeGrid/documentation
This does show account and its contacts in tree hierarchy but
1) it doesnt show up the field names of contact
2) how to display contacts opportunity under each contact.
Regards,
Desai
We have a requirement to Display Accounts, Contacts( of account), Opportunities(of contact) to be displayed in a tree hierarchy using lightning component.
I am not able to customize the code from below link https://developer.salesforce.com/docs/component-library/bundle/lightning:treeGrid/documentation
This does show account and its contacts in tree hierarchy but
1) it doesnt show up the field names of contact
2) how to display contacts opportunity under each contact.
Regards,
Desai
Greetings to you!
Please refer to the below blog which has sample code which might help you with the above requirement. Kindly try to implement according to your requirement.
https://rajvakati.com/2018/04/15/usage-of-lightningtreegrid/
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Thanks for link.
Please be patient with me as i am new to lightning. The above like doesn't show the field names for contacts and opportunities. Is it even possible ?
Regards,
Desai
Try below code, i use this in my org
Component: JS:
Apex Controller:
Output:
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
In the above screenshot, there are only two columns, Name and Phone(Which can be of account and Contact). I wanted to know if we can display Account Field Name and Values and contact field Name and its value . is this possible ?
Something Like this
> Name Account # Phone
Desai 123214 657657
> FirstName LastName Email Phone
XYZ abc abc@l.com 658
> OppName Opp# Status
Opp1 566 Open
Regards,
Desai
Is this possible to do ?
Regards,
Desai
It's possible to add columns but not hide them from Account (if you use Gridtree) something like this
If you want a different view like your's you must go for Tables rather than gridtree
Follow this link https://datatables.net/examples/api/row_details.html
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
Thanks for the above link but this is not what i want.
Can we use two different components to show up the way i want ?
Regards,
Desai