I am trying to set the data property of the datasource to a new array everytime a change event happens in a grid . It works perfectly for a few clicks and then I get a "Uncaught TypeError: Cannot read property 'removeClass' of undefined " ,in the line 2. arrValues() always returns a value and it is not null .Please let me know what is wrong with the code .
1: var setArrayValues =arrValues();
2: $scope.dataSource.data(setArrayValues);
3: $('#grid').data('kendoGrid').setDataSource($scope.dataSource);