Is there any way to force a kendo widget to bind to some data in $scope. I'm having a hard time getting k-data-source to bind between template loads.
Specifically, the k-data-source in the kendo grid below doesn't bind to $scope.gridData when switching between templates in angular. It will however bind when I do a page refresh. The promise does resolve and the data.data does hold my promise with both types of loads. Any insight will be appreciated.
p.s This issue of k-data-source not binding doesn't affect the the k-columns bind. k-columns binds regardless of full page load or template load in angular.
<div kendo-grid="gridK"
k-data-source="gridData"
k-columns="gridColumns"
k-selectable="false"
></div>
.controller('view2Controller', function($scope, tableData) {
//Kendo Grid Data
var promiseGridData = tableData.getData();
promiseGridData.then(function(data){
$scope.gridData = new kendo.data.ObservableArray(data.data);
});
//Kendo Grid Columns
$scope.gridColumns = [
{field: "degree", title: "Degree/Certificate Name"},
{field: "license", title: "License Status"},
{field: "seekingHelp", title: "Seeking Help"}
];
});
mainView.service('tableData', ['$http', '$q', function($http, $q){
var deferred = $q.defer();
$http.get("../gData.json").then(function(data){
deferred.resolve(data);
});
this.getData = function()
{
return deferred.promise;
}
}]);
Here's the application if anyone wants to test it out
https://github.com/ssohal/Kendo
You'll notice that the kendo grid loads on the first page load, but after switching between templates, it will stop binding to its data.