good morning i am making a diagram for a client, but the client wants it in angular. I am more experienced in blazor.
I have a problem with displaying data coming in from an API call made in dotnet. With the same call i did a simple grid and i'm sure that my data are there.
can you please tell me where I am going wrong ? THX .Angular is not my backyard
this the code
Hi,
We've analyzed the code snippet you shared and identified an issue related to binding the data in the datasourceSettings. Instead of directly binding the items property, you should bind the data property. Please refer to the below modified sample and code-snippet:
Code-snippet:
|
app.component.html
<ejs-diagram #diagram id="diagram" width="100%" height="490px" [layout]='layout' [dataSourceSettings]='data' ></ejs-diagram>
app.component.ts
public data: Object = { id: 'Name', parentId: 'Category', dataManager: new DataManager(items), // //binds the external data with node doBinding: (nodeModel: NodeModel, data: DataInfo, diagram: Diagram) => { nodeModel.annotations = [{ /* tslint:disable:no-string-literal */ content: data['Name'], margin: { top: 10, left: 10, right: 10, bottom: 0 }, style: { color: 'black' } }]; /* tslint:disable:no-string-literal */ nodeModel.style = { fill: '#ffeec7', strokeColor: '#f5d897', strokeWidth: 1 }; } };
|
Regards,
Vivisa
Hi there i did so .
I did some other test
Hi,
|
Query |
Solution |
|
Hi there i did so .
public data2: Object = { id: 'Id', parentId: 'ParentId', dataManager: new DataManager(this.items), // //binds the external data with node doBinding: (nodeModel: NodeModel, data: DataInfo, diagram: Diagram) => { nodeModel.annotations = [{ /* tslint:disable:no-string-literal */ content: data['Name'], margin: { top: 10, left: 10, right: 10, bottom: 0 }, style: { color: 'black' } }]; /* tslint:disable:no-string-literal */ nodeModel.style = { fill: '#ffeec7', strokeColor: '#f5d897', strokeWidth: 1 }; } };
Same result i see anything on the diagram Sorry but i can't understand differences between your cod and mine
datasource is "data" ? not "items" ? well changed also it but nothing happens dataSourceSettings]='data'
|
The binding was not proper. In the dataSourceSettings, you bound the property data, but you should change it as data2 to resolve your issue. |
|
I did some other test [dataSourceSettings]='objectdata' also [dataSourceSettings]='items'
|
In the last update, you mentioned that you've properly bound something, but you're encountering an issue. However, when we created a sample, we didn't face any issues. You can refer to the sample below for clarification. Could you please share the items that you're binding in the data so that we can validate them and provide you with more details? Also, please ensure that in the items, you have `Id` and `ParentId` as you mentioned in the object data. |
Regards,
Vivisa
Thx so much. i'll do any test again
Hi,
Thank you for the update. We will wait to hear from you.
Regards,
Vivisa