Hello,
I'm getting the following error using grid and asp.net core web api
ERROR TypeError: Cannot read property 'indexOf' of undefined
at WebApiAdaptor.push../node_modules/@syncfusion/ej2-data/src/adaptors.js.UrlAdaptor.processQuery (adaptors.js:452)
at DataManager.push../node_modules/@syncfusion/ej2-grids/node_modules/@syncfusion/ej2-data/src/manager.js.DataManager.executeLocal (manager.js:116)
at manager.js:164
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:16126)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:498)
at ZoneTask.invoke (zone.js:487)
at timer (zone.js:2281)
Note that this happens before any requests are made to server to retrieve data.
Angular component :
export class MyComponent implements OnInit {
public data: DataManager;
ngOnInit(): void {
this.data = new DataManager({
url: "api/orders",
adaptor: new WebApiAdaptor(),
offline: true
});
}
actionFailure(e: any): void {
console.log(e.error);
}
}
Angular component HTML:
<ejs-grid [dataSource]="data" (actionFailure)='actionFailure($event)'>
<e-columns>
<e-column field="id" headerText="Order ID" textAlign="Right" width="120"></e-column>
<e-column field='CustomerID' headerText='Customer ID' width=150></e-column>
<e-column field='ShipCity' headerText='Ship City' width=150></e-column>
<e-column field='ShipName' headerText='Ship Name' width=150></e-column>
</e-columns>
</ejs-grid>
Can you help me with this please?