From 93fa6f7dfbed7d007d2c025fdc2e30c8a6feeb3c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Nov 2017 17:51:37 +0530 Subject: [PATCH] 24067 : Atlas Anatomy > List Manager > Structures are not appearing in the alphabetical order when select the body system. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 78ed12c..57127a7 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -1301,7 +1301,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', @@ -1317,13 +1317,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(); -- libgit2 0.21.4