Added jsTree to show groups under Inventory/Edit

This commit is contained in:
chouseknecht
2013-05-07 11:49:33 -04:00
parent ced96a1bb3
commit 3c90f91453
78 changed files with 12964 additions and 99 deletions

View File

@@ -185,7 +185,8 @@ InventoriesAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$lo
function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpOrganizationInit, Prompt)
RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpOrganizationInit, Prompt,
TreeInit)
{
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope.
@@ -215,7 +216,6 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
{ hdr: 'Error!', msg: 'Failed to retrieve: ' + scope.orgnization_url + '. GET status: ' + status });
});
for (var set in relatedSets) {
console.log('inventory edit set: ' + set);
scope.search(relatedSets[set].iterator);
}
});
@@ -237,6 +237,10 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
relatedSets[set] = { url: related[set], iterator: form.related[set].iterator };
}
}
// Load the tree view
TreeInit(related.groups);
// 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 });
@@ -247,7 +251,7 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
ProcessErrors(scope, data, status, form,
{ hdr: 'Error!', msg: 'Failed to retrieve inventory: ' + $routeParams.id + '. GET status: ' + status });
});
// Save changes to the parent
scope.formSave = function() {
Rest.setUrl(defaultUrl + $routeParams.id);
@@ -316,5 +320,6 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
InventoriesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpOrganizationInit', 'Prompt' ];
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpOrganizationInit', 'Prompt',
'TreeInit' ];