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

Kendo is removing my prototype

2 Answers 163 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zohar
Top achievements
Rank 1
Zohar asked on 08 Apr 2015, 05:17 PM

Hi,

 I am trying to use Restangular with a Kendo grid. I have my datasource returning Restangular objects that are being displayed in the grid. The problem I am having is that the data object that is passed into the datasource `update`, and `destroy` methods is stripped of its Restangular prototype.  

Why is this happening and is there a way to prevent the overwriting of the prototype?

 

Thanks!

Zohar Jackson

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 10 Apr 2015, 07:35 AM
Hello,

Indeed the Kendo UI DataSource wraps its data items as kendo.data.ObservableObject instances. Then it passes them as plain JavaScript objects to the update and destroy methods so they can be easily serialized to JSON. Your objects are not overwritten - the data source just clones them as ObservableObjects and uses those clones instead. This behavior cannot be disabled.

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Zohar
Top achievements
Rank 1
answered on 10 Apr 2015, 03:20 PM
Got it. Thanks.
Tags
Grid
Asked by
Zohar
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Zohar
Top achievements
Rank 1
Share this question
or