Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Binding/Syncing Variable with Local Data

$
0
0

I have a local variable ($scope.objects) that contains an array of objects.

I have a kendoGrid that has a dataSource that uses the $scope.objects as its data. This grid has the "destroy" command; when I click the "destroy" button, it removes the item from the grid, but not from $scope.objects. Is there any way to bind/sync these two (dataItems in grid and $scope.objects) together?

I found a few ways to handle this, but it all required me to manually change $scope.objects. 

 

01.$scope.objects = [{...}, {...}, {...}];
02.$scope.dataSource = newkendo.data.DataSource({
03.    data: $scope.objects,
04.    //...
05.});
06.$scope.grid = $("grid").kendoGrid({
07.    dataSource: $scope.dataSource,
08.    //...
09.});

 

I am also looking for something similar for create and update.


Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>