This is a migrated thread and some comments may be shown as answers.

After upgrading to Angular 8 getting errors loading data using transport method

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 10 Sep 2019, 02:21 PM

Hi Guys,

Just want to tell you about a problem I've found in case it affects anybody else.

After upgrading from Angular 7 to Angular 8 we kept getting the error Cannot read property 'data' of undefined for any kendo grids using a transport object.

The error was in kendo.data.js, what was happening was the kendo code is using $.extends to clone the transport object but only the properties were being cloned, so when kendo tries to execute the read function, it does not exist on the cloned transport object.

It turns out that as part of the Angular upgrade, typescript is updated to 3.5.3 and the CLI has been changed to build using ES2015 rather than es5. ES2015 uses native javascript classes and the version of jquery we are using (1,11,1) doesn't include the functions when extending those classes.

As a work around, we have changed the target back to es5 in the tsconfig.json. 

Hopefully Kendo will switch to Object.assign instead of $.extends to clone their object as this plays nice with ES2015 / ES6

1 Answer, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 12 Sep 2019, 01:32 PM
Hi Jonathan,

Thank you very much for taking the time and reporting the issue you are experiencing. This might be helpful to others facing similar scenarios in their projects.

Indeed, that is correct. Internally, we are using $.extend() method to clone the transport objects. Changing the target back to ES5 in the tsconfig.json is a good workaround as for now. This way jQuery will include the functions when extending the native JavaScript classes.

If you have the time, you could report the above as a bug in our UserVoice portal describing the desired changes that you would want to see in our future versions of the components. Once we are sure that this is the right direction to go and there are reasonable number of users asking for it, we will apply the necessary changes.

Kind regards,
Nikolay
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or