Essentially, the dataSource for the kendo grid has a default data called selVal. If any key from selval matches with dtoVal, I want to delete everything from selVa. Is it possible to implement this with the code below? It's not deleting selVal elements from the array. Any ideas?
ctrl.js
$scope.handleControlOwnerCancel = function(){
this.ctrlOwnerModal.close();
var dtoVal = $scope.controlDTO.controlOwners;
var selVal = $scope.selectedOwners;
for (var i = 0; i < dtoVal.length; i++) {
for (var j=0; j<selVal.length; j++) {
if (dtoVal[i].workerKey !== selVal[j].workerKey) {
$scope.selectedOwners = $scope.controlDTO.controlOwners;
controlOwnersDataSource();
}
}
}
};