Fixed issue with selected users based on user.id rathr than set index. Fixed dataLoad callback not being destroyed after controller routine exits.

This commit is contained in:
Chris Houseknecht
2013-05-06 22:18:44 -04:00
parent ccb732bd69
commit ced96a1bb3
8 changed files with 60 additions and 52 deletions

View File

@@ -11,7 +11,7 @@
'use strict';
function OrganizationsList ($scope, $rootScope, $location, $log, Rest, Alert, LoadBreadCrumbs, Prompt, GetAPIDefaults,
GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope)
GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors)
{
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope.
@@ -67,7 +67,7 @@ function OrganizationsList ($scope, $rootScope, $location, $log, Rest, Alert, Lo
}
OrganizationsList.$inject=[ '$scope', '$rootScope', '$location', '$log', 'Rest', 'Alert', 'LoadBreadCrumbs', 'Prompt', 'GetAPIDefaults',
'GenerateList', 'OrganizationList', 'SearchInit', 'PaginateInit', 'ClearScope' ];
'GenerateList', 'OrganizationList', 'SearchInit', 'PaginateInit', 'ClearScope', 'ProcessErrors'];
function OrganizationsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm,
@@ -129,7 +129,7 @@ function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $rout
var relatedSets = {};
// After the Organization is loaded, retrieve each related set
scope.$on('dataLoaded', function() {
scope.$on('organizationLoaded', function() {
for (var set in relatedSets) {
scope.search(relatedSets[set].iterator);
}
@@ -155,7 +155,7 @@ function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $rout
// Initialize related search functions. Doing it here to make sure relatedSets object is populated.
RelatedSearchInit({ scope: scope, form: form, relatedSets: relatedSets });
RelatedPaginateInit({ scope: scope, relatedSets: relatedSets });
scope.$emit('dataLoaded');
scope.$emit('organizationLoaded');
})
.error( function(data, status, headers, config) {
ProcessErrors(scope, data, status, form,