Commit 3b0f23f0204d360270cb69e9f09863e709f2bcf3
1 parent
555befc0
commit changes for search functionality
Showing
1 changed file
with
6 additions
and
6 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -720,7 +720,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | @@ -720,7 +720,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | ||
720 | } | 720 | } |
721 | 721 | ||
722 | //call watch on '$scope.VocabTermTxt and compile <li> and append to <ul> on first time load | 722 | //call watch on '$scope.VocabTermTxt and compile <li> and append to <ul> on first time load |
723 | - $scope.$watch('$scope.VocabTermTxt', function (newValue, oldValue, scope) { | 723 | + $scope.$watch('$rootScope.vocabTermDataArray[0].vocabTermTxt', function (newValue, oldValue, scope) { |
724 | 724 | ||
725 | //This is added as the $scope.VocabTermTxt can change while changing view also the li elements need to be removed | 725 | //This is added as the $scope.VocabTermTxt can change while changing view also the li elements need to be removed |
726 | //Remove the list and then Repopulate | 726 | //Remove the list and then Repopulate |
@@ -728,7 +728,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | @@ -728,7 +728,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | ||
728 | $('#searchListDiv').empty() | 728 | $('#searchListDiv').empty() |
729 | //Delay compile of ul li so that the remove of li is completed. | 729 | //Delay compile of ul li so that the remove of li is completed. |
730 | $timeout(function () { | 730 | $timeout(function () { |
731 | - var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"><li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">' + | 731 | + var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"><li ng-repeat="item in vocabTermDataArray[0].vocabTermTxt| filter:{ _TermText: searchFilter}">' + |
732 | '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + | 732 | '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + |
733 | ' </li></ul>').appendTo('#searchListDiv') | 733 | ' </li></ul>').appendTo('#searchListDiv') |
734 | $compile($e2)($scope); | 734 | $compile($e2)($scope); |
@@ -7731,18 +7731,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | @@ -7731,18 +7731,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | ||
7731 | $scope.ShowSearch = function () { | 7731 | $scope.ShowSearch = function () { |
7732 | console.log('ShowSearch is called'); | 7732 | console.log('ShowSearch is called'); |
7733 | //this check is for log only because we are writing length so need to check if its not null or undefined | 7733 | //this check is for log only because we are writing length so need to check if its not null or undefined |
7734 | - if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) | ||
7735 | - console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length) | 7734 | + if ($rootScope.vocabTermDataArray[0].vocabTermTxt != null || $rootScope.vocabTermDataArray[0].vocabTermTxt != undefined) |
7735 | + console.log('$scope.VocabTermTxt.length= ' + $rootScope.vocabTermDataArray[0].vocabTermTxt.length) | ||
7736 | 7736 | ||
7737 | $timeout(function () { | 7737 | $timeout(function () { |
7738 | - if (($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) && ($scope.VocabTermTxt.length > 0)) { | 7738 | + if (($rootScope.vocabTermDataArray[0].vocabTermTxt != null || $rootScope.vocabTermDataArray[0].vocabTermTxt != undefined) && ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0)) { |
7739 | 7739 | ||
7740 | $scope.IsSearchVisible = true; | 7740 | $scope.IsSearchVisible = true; |
7741 | document.getElementById("termlistfilter").style.display = "block"; | 7741 | document.getElementById("termlistfilter").style.display = "block"; |
7742 | } | 7742 | } |
7743 | else { | 7743 | else { |
7744 | $rootScope.loadSearchDataForBodyView(); | 7744 | $rootScope.loadSearchDataForBodyView(); |
7745 | - if ($scope.VocabTermTxt.length > 0) { | 7745 | + if ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0) { |
7746 | $scope.ShowSearch(); | 7746 | $scope.ShowSearch(); |
7747 | } | 7747 | } |
7748 | } | 7748 | } |