We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Angular Grid WebApiAdaptor error

Thread ID:

Created:

Updated:

Platform:

Replies:

143373 Mar 17,2019 08:33 PM UTC Mar 18,2019 08:39 AM UTC Angular - EJ 2 1
loading
Tags: Grid
RA
Asked On March 17, 2019 08:33 PM UTC

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?

Thavasianand Sankaranarayanan [Syncfusion]
Replied On March 18, 2019 08:39 AM UTC

Hi Rami, 

Greetings from Syncfusion. 

Query: I'm getting the following error using grid and asp.net core web api 
ERROR TypeError: Cannot read property 'indexOf' of undefined 

We have analyzed your query but we are unable to reproduce the reported issue at our end. Please provide the below mentioned details, it will be helpful for us to provide a better solution asap. 

  1. Grid package version details?
  2. Full grid code example(including server side code)?
  3. Please try to reproduce the reproduce the reported issue in below attached sample if possible?


Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;