- Home
- Forum
- Angular - EJ 2
- Treegrid not displaying Data
Treegrid not displaying Data
I am trying to use the run the example from the documenation page but it seems that the treegrid is not loading the data. The component version is "@syncfusion/ej2-angular-treegrid": "^18.3.40".
import { Component } from '@angular/core';
import { DataManager, WebApiAdaptor } from '@syncfusion/ej2-data';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'TTTestTreeGrid';
public data: DataManager;
ngOnInit(): void {
this.data = new DataManager({
url:
'https://ej2services.syncfusion.com/production/web-services/api/SelfReferenceData',
adaptor: new WebApiAdaptor(),
crossDomain: true,
offline: true,
});
console.log(this.data.dataSource)
}
}
<ejs-treegrid
[dataSource]="data"
[treeColumnIndex]="1"
parentIdMapping="ParentItem"
idMapping="TaskID"
[allowPaging]="true"
>
<e-columns>
<e-column
field="TaskID"
headerText="Task ID"
width="90"
textAlign="Right"
></e-column>
<e-column field="TaskName" headerText="Task Name" width="170"></e-column>
<e-column
field="StartDate"
headerText="Start Date"
width="130"
format="yMd"
textAlign="Right"
></e-column>
<e-column
field="Duration"
headerText="Duration"
width="80"
textAlign="Right"
></e-column>
</e-columns>
</ejs-treegrid>
SIGN IN To post a reply.
3 Replies
FS
Farveen Sulthana Thameeztheen Basha
Syncfusion Team
October 15, 2020 03:01 PM UTC
Hi Albert,
Thanks for contacting Syncfusion Support.
Query#:- Treegrid not displaying Data
We have checked your reported problem by preparing sample with version 18.3.40 but we are unable to reproduce this issue at our end. Refer to the sample Link:-
Documentation Link:- https://ej2.syncfusion.com/angular/documentation/treegrid/data-binding/#offline-mode
Screenshot:-
We need some more additional details to find the cause of the issue. Share us the following details.
- StackTrace of Script Error (if any) in console window.
- Video Demo to replicate the issue.
- If possible replicate the issue in the above sample and revert us back.
Regards,
Farveen sulthana T
AK
Albert K
October 16, 2020 03:04 AM UTC
For your information, I am trying to use the OdataV4Adaptor and the data that I received need to be manipulated. Apparently the treegrid parentIDMapping, IdMapping needs to be in numeric format vs Diagram component which can be numeric or string.
The issue i am getting is sometimes the Treeview do appear and after pressing F5 to refresh the browser, sometimes about 40% of the time it would not display the data.
FS
Farveen Sulthana Thameeztheen Basha
Syncfusion Team
October 16, 2020 04:33 PM UTC
Hi Albert,
Query#:- Sometimes about 40% of the time it would not display the data.
We need some more additional details to find the cause of the issue. Share us the following details.
- Complete TreeGrid code example.
- Video Demo to replicate the issue(any specific scenario)
- Share Network Tab details(whether post has been sent to Odata to get the data).
- Have you used any service Link for Odata service. If yes please share.
From the provided details we will try to replicate the problem at our end and provide you solution accordingly.
Regards,
Farveen sulthana T
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
AK Albert K
- Oct 14, 2020 08:44 AM UTC
- Oct 16, 2020 04:33 PM UTC