diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
index dea8e04..356d14b 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -1310,7 +1310,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
var imageId = $rootScope.imageId;
$scope.pinDataUrl = "aa_dat_pinterm_" + imageId;
$rootScope.bodySystemTermArray = [];
-
+ $rootScope.sortedListArray = [];
$.ajax({
url: '~/../content/data/json/aa/aa_pinterm/' + $scope.pinDataUrl + '.json',
type: 'GET',
@@ -1326,13 +1326,40 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
if ($scope.aaPinData[i]._TermId == $rootScope.bodySystemTermArray[j].termNumbr) {
if ($rootScope.bodySystemTermArray[j].language == "1") {
console.log($rootScope.bodySystemTermArray[j].text);
- var $selectedOptions = $('').appendTo("#termList")
- $compile($selectedOptions)($scope);
+ $rootScope.sortedListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr });
+
}
}
}
}
}
+
+
+ for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) {
+
+ for (j = i + 1; j <= $rootScope.sortedListArray.length - 1; j++) {
+
+ if ($rootScope.sortedListArray[i].title.substr(0, 1) > $rootScope.sortedListArray[j].title.substr(0, 1)) {
+
+ var termText = $rootScope.sortedListArray[i].title;
+ var termNumbr = $rootScope.sortedListArray[i].termNumbr;
+ var termLanguage = $rootScope.sortedListArray[i].language;
+
+ $rootScope.sortedListArray[i].title = $rootScope.sortedListArray[j].title;
+ $rootScope.sortedListArray[i].termNumbr = $rootScope.sortedListArray[j].termNumbr;
+ $rootScope.sortedListArray[i].language = $rootScope.sortedListArray[j].language;
+
+ $rootScope.sortedListArray[j].title = termText;
+ $rootScope.sortedListArray[j].termNumbr = termNumbr;
+ $rootScope.sortedListArray[j].language = termLanguage;
+ }
+ }
+ }
+
+ for (var j = 0; j <= $rootScope.sortedListArray.length - 1; j++) {
+ var $selectedOptions = $('').appendTo("#termList")
+ $compile($selectedOptions)($scope);
+ }
}
});
$("#totalTerms").empty();