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

Kendo Grid + Angular + CRUD

5 Answers 207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JRC.T.6
Top achievements
Rank 1
JRC.T.6 asked on 27 Nov 2015, 10:05 AM

Hi,

we are trying to use a kendo grid with angular, as follow

http://plnkr.co/edit/AkKBtTVWRrhvJyF8Kmfd?p=preview 

 

and we found a strange behaviour: if you try to delete all the elements in the grid, you will see that the last one will persist in the angular tables.

Can you help us to understand why?

 Thanks

5 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 27 Nov 2015, 03:09 PM
Hi Alessio,

For some reason Angular is failing to detect that the grid dataSource has changed.

You may need to manually cal $scope.$apply after removing the last item. You can use the change event in the datasource. Example: http://plnkr.co/edit/dygsLFYh9vRm8R9NBaSe?p=preview

Meanwhile we will take a look whether this is a bug in the datasource or not.

Regards,
Genady Sergeev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
JRC.T.6
Top achievements
Rank 1
answered on 30 Nov 2015, 01:23 PM

Thank you for your help,
I have tested Angular-Kendo integration.
In the following example, the data source modifications did not apply on dynamicData variable, we need two-way binding for load/validation/save data.

http://plnkr.co/edit/1exSikM2NTFGarhGDgt6?p=preview

How we can get a constantly update dynamicData?
Is there other "smart" way to use grid?

Thanks,
Alessio

0
Petyo
Telerik team
answered on 02 Dec 2015, 05:12 PM

Hello Alessio,

sorry for the delay. the change: scope.apply configuration caused some javascript errors. I removed it and updated the kendo ui version, the example seems to be working as expected now.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
JRC.T.6
Top achievements
Rank 1
answered on 03 Dec 2015, 09:22 AM
Hi all,
I am sorry but I didn't understand your suggestions.
To remove "change" property causes the Kendo-Angular inconsistency and updating the libraries the behavior remains the same.
The last example doesn't seems to be working as expected and the update of the libraries doesn't fix errors.
http://plnkr.co/edit/pvgKdEY8NZYIaN32YYhy?p=preview

What's wrong?
How we can get a constantly update dynamicData?
Is there other "smarter" way to use grid?

Thanks
0
Rosen
Telerik team
answered on 07 Dec 2015, 04:44 PM

Hello Alessio,

 

I'm afraid that it is not possible to directly synchronize the dynamic data as it is not the same instance which is bound to the DataSource. AS you may know this data is wrapped in a ObserverableArray/ObservableObject instances when passed into the DataSource, thus the link between the variables is lost.

You can try exposing the dataSource data as a function instead. You should also keep manually updating the scope in the DataSource change event. Here is an updated version of the sample which demonstrates this in action.

 

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
JRC.T.6
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
JRC.T.6
Top achievements
Rank 1
Petyo
Telerik team
Rosen
Telerik team
Share this question
or