Hello Syncfusion team,
I've been working with the Syncfusion Gantt Chart and using a custom adaptor to handle data loading. I have a setup where:
```javascript
```javascript
```javascript
```javascript
Thank you in advance for your support!
Hi Loai,
return dm.RequiresCounts ? Json(new { result = DataSource, count = count, flatData = data }) : Json(DataSource); |
HomeController.cs:- if (dm.Expand != null && dm.Expand[0] == "CollapsingAction") // setting the skip index based on collapsed parent { string IdMapping = "taskId"; List<WhereFilter> CollapseFilter = new List<WhereFilter>(); CollapseFilter.Add(new WhereFilter() { Field = IdMapping, value = dm.Where[0].value, Operator = dm.Where[0].Operator }); var CollapsedParentRecord = operation.PerformFiltering(DataSource, CollapseFilter, "and"); var index = data.Cast<object>().ToList().IndexOf(CollapsedParentRecord.Cast<object>().ToList()[0]); dm.Skip = index; } else if (dm.Expand != null && dm.Expand[0] == "ExpandingAction") // setting the skip index based on expanded parent { string IdMapping = "taskId"; List<WhereFilter> ExpandFilter = new List<WhereFilter>(); ExpandFilter.Add(new WhereFilter() { Field = IdMapping, value = dm.Where[0].value, Operator = dm.Where[0].Operator }); var ExpandedParentRecord = operation.PerformFiltering(DataSource, ExpandFilter, "and"); var index = data.Cast<object>().ToList().IndexOf(ExpandedParentRecord.Cast<object>().ToList()[0]); dm.Skip = index; } |
Demo - Gantt Chart · Big Data Set · Syncfusion React UI Components
Documentation - Data binding in React Gantt component | Syncfusion
Remote data in React Treegrid component | Syncfusion
Regards,
Sridharan
Hello Syncfusion Team,
Thank you for the quick response!
I’ve tried the suggestions you provided, and I’m encountering some new issues.
I’m facing issues with hierarchy, levels, and proper child assignment in the Gantt Chart component while using a custom data manager adaptor in my Next.js application.
I’m working with a hierarchical data structure where tasks can have multiple levels of nested children.
Here’s a breakdown of the behavior I’m seeing:
Initial Load: After receiving the initial data from the backend, the Gantt chart displays correctly.
Initial Load Screenshot: Image 1 in .rar
Initial Backend Response:
{
"result": [
{
"taskId": 166395,
"taskName": "SAFA TWO BASELINE PROGRAMME _Rev .0 ver.02 updates as of 13-Sep-24",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": null,
"isExpanded": true,
"isParent": true,
"predecessor": null,
"level": null
},
{
"taskId": 166396,
"taskName": "General",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166397,
"taskName": "Authority Approvals & NOC's",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2027-09-28T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2027-09-28T18:00:00Z",
"duration": "1255",
"progress": 11,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166398,
"taskName": "Engineering",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2027-11-19T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2027-11-19T18:00:00Z",
"duration": "1307",
"progress": 11,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166399,
"taskName": "Procurement",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-01-08T13:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-01-08T13:00:00Z",
"duration": "1356",
"progress": 10,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166400,
"taskName": "Construction",
"startDate": "2024-04-23T08:00:00Z",
"endDate": "2028-05-10T18:00:00Z",
"baselineStartDate": "2024-04-26T08:00:00Z",
"baselineEndDate": "2028-05-10T18:00:00Z",
"duration": "1479",
"progress": 9,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166401,
"taskName": "Final Works",
"startDate": "2024-09-30T18:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-09-30T18:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1386",
"progress": 0,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
}
],
"count": 7
}
First Expand Action: When expanding the task "General," it initially displays as expected.
First Expand Screenshot:
Image 2
in .rar
Backend Response for First Expand:
{
"result": [
{
"taskId": 166396,
"taskName": "General",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": 166395,
"isExpanded": true,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166402,
"taskName": "Project Milestone",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": 166396,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 2
},
{
"taskId": 166403,
"taskName": "Mobilization&Demoblization",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-04-12T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-04-12T18:00:00Z",
"duration": "1206",
"progress": 10,
"parentID": 166396,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 2
},
{
"taskId": 166397,
"taskName": "Authority Approvals & NOC's",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2027-09-28T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2027-09-28T18:00:00Z",
"duration": "1255",
"progress": 11,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166398,
"taskName": "Engineering",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2027-11-19T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2027-11-19T18:00:00Z",
"duration": "1307",
"progress": 11,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166399,
"taskName": "Procurement",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-01-08T13:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-01-08T13:00:00Z",
"duration": "1356",
"progress": 10,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166400,
"taskName": "Construction",
"startDate": "2024-04-23T08:00:00Z",
"endDate": "2028-05-10T18:00:00Z",
"baselineStartDate": "2024-04-26T08:00:00Z",
"baselineEndDate": "2028-05-10T18:00:00Z",
"duration": "1479",
"progress": 9,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166401,
"taskName": "Final Works",
"startDate": "2024-09-30T18:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-09-30T18:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1386",
"progress": 0,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
}
],
"count": 9
}
Nested Expansion Issue: The issue occurs when I expand a nested child under "General." The hierarchy becomes misaligned, and the levels appear incorrectly.
Nested Expand Screenshot:
Image 3
in .rar
Backend Response for Nested Expand:
{
"result": [
{
"taskId": 166402,
"taskName": "Project Milestone",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": 166396,
"isExpanded": true,
"isParent": true,
"predecessor": null,
"level": 2
},
{
"taskId": 166424,
"taskName": "Contractual Milestones",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": 166402,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 3
},
{
"taskId": 166397,
"taskName": "Authority Approvals & NOC's",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2027-09-28T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2027-09-28T18:00:00Z",
"duration": "1255",
"progress": 11,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166398,
"taskName": "Engineering",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2027-11-19T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2027-11-19T18:00:00Z",
"duration": "1307",
"progress": 11,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166399,
"taskName": "Procurement",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-01-08T13:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-01-08T13:00:00Z",
"duration": "1356",
"progress": 10,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166400,
"taskName": "Construction",
"startDate": "2024-04-23T08:00:00Z",
"endDate": "2028-05-10T18:00:00Z",
"baselineStartDate": "2024-04-26T08:00:00Z",
"baselineEndDate": "2028-05-10T18:00:00Z",
"duration": "1479",
"progress": 9,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166401,
"taskName": "Final Works",
"startDate": "2024-09-30T18:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-09-30T18:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1386",
"progress": 0,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166425,
"taskName": "Control Milestones",
"startDate": "2027-12-06T13:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2027-12-06T13:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "224",
"progress": 0,
"parentID": 166402,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 3
},
{
"taskId": 166403,
"taskName": "Mobilization&Demoblization",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-04-12T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-04-12T18:00:00Z",
"duration": "1206",
"progress": 10,
"parentID": 166396,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 2
}
],
"count": 11
}
Page Refresh Issue: When I refresh the page, the tasks lose their indentation, and all items appear on the first level, with no child-parent relationships.
Page Refresh Screenshot:
Image 4
in .rar
Backend Response on Refresh:
{
"result": [
{
"taskId": 166395,
"taskName": "SAFA TWO BASELINE PROGRAMME _Rev .0 ver.02 updates as of 13-Sep-24",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": null,
"isExpanded": true,
"isParent": true,
"predecessor": null,
"level": null
},
{
"taskId": 166396,
"taskName": "General",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": 166395,
"isExpanded": true,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166402,
"taskName": "Project Milestone",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": 166396,
"isExpanded": true,
"isParent": true,
"predecessor": null,
"level": 2
},
{
"taskId": 166424,
"taskName": "Contractual Milestones",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1548",
"progress": 9,
"parentID": 166402,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 3
},
{
"taskId": 166397,
"taskName": "Authority Approvals & NOC's",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2027-09-28T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2027-09-28T18:00:00Z",
"duration": "1255",
"progress": 11,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166398,
"taskName": "Engineering",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2027-11-19T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2027-11-19T18:00:00Z",
"duration": "1307",
"progress": 11,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166399,
"taskName": "Procurement",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-01-08T13:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-01-08T13:00:00Z",
"duration": "1356",
"progress": 10,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166400,
"taskName": "Construction",
"startDate": "2024-04-23T08:00:00Z",
"endDate": "2028-05-10T18:00:00Z",
"baselineStartDate": "2024-04-26T08:00:00Z",
"baselineEndDate": "2028-05-10T18:00:00Z",
"duration": "1479",
"progress": 9,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166401,
"taskName": "Final Works",
"startDate": "2024-09-30T18:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2024-09-30T18:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "1386",
"progress": 0,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
{
"taskId": 166425,
"taskName": "Control Milestones",
"startDate": "2027-12-06T13:00:00Z",
"endDate": "2028-07-17T18:00:00Z",
"baselineStartDate": "2027-12-06T13:00:00Z",
"baselineEndDate": "2028-07-17T18:00:00Z",
"duration": "224",
"progress": 0,
"parentID": 166402,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 3
},
{
"taskId": 166403,
"taskName": "Mobilization&Demoblization",
"startDate": "2024-04-22T08:00:00Z",
"endDate": "2028-04-12T18:00:00Z",
"baselineStartDate": "2024-04-22T08:00:00Z",
"baselineEndDate": "2028-04-12T18:00:00Z",
"duration": "1206",
"progress": 10,
"parentID": 166396,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 2
}
],
"count": 11
}
And the isuue keeps happening with expanding and collapsing childeren all tasks lose their
hierarchy.
I believe the issue might be related to incorrect level assignments and child-parent mapping upon data retrieval.
Here’s an example of the row data for a correct item after the first expand action:
Correct Row Data Example:
{
"index": 2,
"taskId": 166402,
"taskName": "Project Milestone",
"startDate": "2024-04-22T08:00:00.000Z",
"endDate": "2028-07-17T18:00:00.000Z",
"baselineStartDate": "2024-04-22T08:00:00.000Z",
"baselineEndDate": "2028-07-17T18:00:00.000Z",
"duration": "1548",
"progress": 9,
"parentID": 166396,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 2,
"taskData": {
"taskId": 166402,
"taskName": "Project Milestone",
"startDate": "2024-04-22T08:00:00.000Z",
"endDate": "2028-07-17T18:00:00.000Z",
"baselineStartDate": "2024-04-22T08:00:00.000Z",
"baselineEndDate": "2028-07-17T14:00:00.000Z",
"duration": 1548,
"progress": 9,
"parentID": 166396,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 2
},
"parentItem": {
"taskId": 166396,
"taskName": "General",
"startDate": "2024-04-22T08:00:00.000Z",
"endDate": "2028-07-17T18:00:00.000Z",
"baselineStartDate": "2024-04-22T08:00:00.000Z",
"baselineEndDate": "2028-07-17T18:00:00.000Z",
"duration": "1548",
"progress": 9,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1,
"taskData": {
"taskId": 166396,
"taskName": "General",
"startDate": "2024-04-22T08:00:00.000Z",
"endDate": "2028-07-17T18:00:00.000Z",
"baselineStartDate": "2024-04-22T08:00:00.000Z",
"baselineEndDate": "2028-07-17T18:00:00.000Z",
"duration": "1548",
"progress": 9,
"parentID": 166395,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1
},
"uniqueID": "treeGridgantt_292070222_0_data_9",
"index": 334,
"hasChildRecords": true,
"checkboxState": "uncheck",
"parentItem": null,
"expanded": true
},
"parentUniqueID": "treeGridgantt_292070222_0_data_9",
"uniqueID": "treeGridgantt_292070222_0_data_23",
"checkboxState": "uncheck",
"hasChildRecords": true,
"expanded": false,
"column": {
"disableHtmlEncode": true,
"allowSorting": true,
"allowResizing": true,
"allowFiltering": true,
"allowGrouping": true,
"allowReordering": true,
"showColumnMenu": true,
"enableGroupByFormat": false,
"allowEditing": true,
"showInColumnChooser": true,
"allowSearching": true,
"autoFit": false,
"sortDirection": "Descending",
"field": "taskName",
"width": "300",
"textAlign": "Left",
"editType": "stringedit",
"type": "string",
"uid": "grid-column2",
"foreignKeyField": "taskName",
"visible": true,
"index": 2
}
}And here’s an example of an incorrect row data response in the wrong scenarios for the same task:
Incorrect Row Data Example:
{
"index": 553,
"taskId": 166402,
"taskName": "Project Milestone",
"startDate": "2024-04-22T08:00:00.000Z",
"endDate": "2028-07-17T18:00:00.000Z",
"baselineStartDate": "2024-04-22T08:00:00.000Z",
"baselineEndDate": "2028-07-17T18:00:00.000Z",
"duration": "1548",
"progress": 9,
"parentID": 166396,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 1,
"taskData": {
"taskId": 166402,
"taskName": "Project Milestone",
"startDate": "2024-04-22T08:00:00.000Z",
"endDate": "2028-07-17T18:00:00.000Z",
"baselineStartDate": "2024-04-22T08:00:00.000Z",
"baselineEndDate": "2028-07-17T18:00:00.000Z",
"duration": "1548",
"progress": 9,
"parentID": 166396,
"isExpanded": false,
"isParent": true,
"predecessor": null,
"level": 2
},
"uniqueID": "treeGridgantt_292070222_0_data_10",
"hasChildRecords": true,
"checkboxState": "uncheck",
"column": {
"disableHtmlEncode": true,
"allowSorting": true,
"allowResizing": true,
"allowFiltering": true,
"allowGrouping": true,
"allowReordering": true,
"showColumnMenu": true,
"enableGroupByFormat": false,
"allowEditing": true,
"showInColumnChooser": true,
"allowSearching": true,
"autoFit": false,
"sortDirection": "Descending",
"field": "taskName",
"width": "300",
"textAlign": "Left",
"editType": "stringedit",
"type": "string",
"uid": "grid-column2",
"foreignKeyField": "taskName",
"visible": true,
"index": 2
}
}
Could you please advise on how to resolve this hierarchy and level assignment issue to ensure tasks are indented correctly and children are assigned to the correct parents on every expand action and to make everything correct also with scrolling and all actions ?
Thank you in advance for your help!
I wanted to add also that I'm using the correct task settings for mapping :
let taskSettings = {
id: 'taskId',
name: 'taskName',
progress: 'progress',
startDate: 'startDate',
endDate: 'endDate',
duration: 'duration',
baselineStartDate: 'baselineStartDate',
baselineEndDate: 'baselineEndDate',
hasChildMapping: 'isParent',
parentID: 'parentID',
expandStateMapping: 'isExpanded'
};
Loai
We have reviewed your query, and from the information provided, it appears that the returned data is being sent incorrectly. We render the returned data in the Gantt chart in the order it is received, and an incorrect order is leading to the error you mentioned. To investigate further, please provide us with the following information for validation.
Client side NextJs - https://www.syncfusion.com/downloads/support/directtrac/general/ze/REACTN~1-450339436
Server side -https://www.syncfusion.com/downloads/support/directtrac/general/ze/loadOnDemandMultiLevel_1-1566860281.zip
Regards,
Udhayakumar
Hello,
Thank you for your help. I have attached a document of a similar exaample where we see the issue in details along with screenshots and server response.
I have also attached the backend code in the attachement and i have tried to follow almost the same code as the example you have provided.
Thank you for your help.
Also, if you note from what Loai has previously posted, In the correct Data Row Return, there's 'parentUniqueID' and another item called `parentItem`. While on the incorrect Data Row Return, we do not get these values from the library.
in summary we have two issues described here, there's one related to incorrect order of data returned. And the other one is, even if data is returned correctly, indentation is not reflecting the actual data. We have noticed indentiation is getting messed up after 2 levels exactly or after refreshing the page
For complete reference to our code, here is a snippet of our customAdapter from the frontend:
and here's how we call data manager
and here's our GanttChart component:
Mostafa,
Query 1 - there's one related to incorrect order of data returned.
After validating the sample, we found that the AppendChildren method had incorrect index updation, which caused an incorrect order of data being returned. We have modified the method to resolve this issue. Please refer to the code snippet and sample for reference.
HomeController.cs:- private void AppendChildren(DataManagerRequest dm, List<TreeData> ChildRecords, TreeData ParentValue, Dictionary<string, List<TreeData>> GroupData, List<TreeData> data) // Getting child records for the respective parent { string TaskId = ParentValue.taskId.ToString(); //var index = data.IndexOf(ParentValue); // Removed the initialization of 'index' DataOperations operation = new DataOperations(); foreach (var Child in ChildRecords) { if ((bool)ParentValue.IsExpanded) { string ParentId = Child.parentID.ToString(); if (TaskId == ParentId) { ((IList)data).Insert(++parentIndex, Child); // new modified code if (GroupData.ContainsKey(Child.taskId.ToString())) { .................................................................... } } } } |
Query 2 - And the other one is, even if data is returned correctly, indentation is not reflecting the actual data.
We have reviewed your query, and we are able to replicate the issue "On expand parent records, data not aligned properly when loadOnDemand and Virtualization enabled" in Gantt Chart.
Regards,
Sridharan
Mostafa,
Query 2 - And the other one is, even if data is returned correctly, indentation is not reflecting the actual data.
We are glad to announce that our patch release (v27.2.5) is rolled out successfully. In this release, we have added the fix for the reported issue.
Sample - local sample will attach in forum.
Root cause - We are updating the level to 0 for all records which fetched from treegrid for load child on demand sample in createRecord method.
Release notes - Essential Studio for EJ2 TypeScript Weekly Release Release Notes
Regards,
Sridharan
Mostafa,
Please ignore the previous update.
Query 2 - And the other one is, even if data is returned correctly, indentation is not reflecting the actual data.
We are glad to announce that our patch release (v27.2.5) is rolled out successfully. In this release, we have added the fix for the reported issue.
Client sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/NEXTJS~117387397
Server Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/MutliLevelLOD1619137247
Root cause - We are updating the level to 0 for all records which fetched from treegrid for load child on demand sample in createRecord method.
Release notes - Essential Studio for EJ2 TypeScript Weekly Release Release Notes
Regards,
Sridharan
In React Gantt (v29.2.4), when using DataManager for remote data with lazy loading, the task hierarchy is not rendering correctly — child tasks aren't aligned under their parents as expected
Jaya,
For your query, we have prepared a sample and attempted to replicate the reported issue, but we were unable to reproduce it on our end.
We suspect that the issue may be caused by your backend returning incorrect data. We have attached a working sample and a video demonstration for your reference.
Refer to our attached backend code in the HomeController.cs file and modify your codes based on it and check whether the backend returns the correct data to the frontend. Also, ensure that you are using the latest version, v29.2.11, when testing.
If the issue still persists, kindly share the following details to proceed with validation:
Client Sample - 56acobra (duplicated) - StackBlitz
Server Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/MutliLevelLOD
Documentation - Data binding in React Gantt component | Syncfusion
Regards,
Sridharan