In the initial scenario, I managed to disable all parent elements except for the currently selected one.
This code snippet is from checkbox.js:
if (geoLocation.id === 5657){
var getParent = geoLocation.parent();
$.each(geoLocation.parent(),function(index,location) {
if (location.id !== geoLocation.id) {
var disableItemId = 'disabled' + location.id;
// Get the model
var model = $parse(disableItemId);
// Assign a value to it
model.assign($scope, true);
}
});
Now, I am attempting to disable all child elements for parents that were disabled in the previous step. How can I accomplish this with the following code? Any assistance would be greatly appreciated.
This is what I have tried so far...
$.each(geoLocation.parent().items,function(index,location) {
if(location.id !== geoLocation.id){
var disableItemId = 'disabled' + location.children.data;
// Get the model
var model = $parse(disableItemId);
// Assign a value to it
model.assign($scope, true);
}
});
console.log(getParent);