Hi Vineeth,Greetings to you!If you have a large number of nested items that would delay the loading of your data, consider loading your nested items asynchronously. The nested items are displayed only when you expand the particular row. To do so, initialize your data without nested items. var mydata = [
{
"name": "123556-A",
"accountName": "Acme Corporation (Bay Area)",
:
:
"_children": []
}, //more data
];
Define the nested items separately.
childrenData: {
"123556-A": [
{
"name": "123556-A-A",
"accountName": "Acme Corporation (Oakland)",
:
:
},
{
"name": "123556-A-B",
"accountName": "Acme Corporation (San Francisco)",
:
:
}
],
Handle asynchronous loading of nested items when a row is expanded using the ontoggle action. Find the name of the row being expanded and check if data for the nested items are already available before retrieving and displaying the nested items.
Please refer to the below link for more information:https://developer.salesforce.com/docs/component-library/bundle/lightning:treeGrid/documentationI 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.({
handleRowToggle: function(cmp, event, helper) {
var rowName = event.getParam('name');
var hasChildrenContent = event.getParam('hasChildrenContent');
if (!hasChildrenContent) {
// Retrieve and display the nested items
// by passing in the original data, row name, and data for the nested items
}
}
})
Thanks and Regards,
Khan Anas
1 risposta