Commit 0182a217 authored by dgoud-nisum-com's avatar dgoud-nisum-com Committed by rbonthala-nisum-com

modified search(case insensitive) (#53)

parent f3af757e
...@@ -211,9 +211,10 @@ myApp.controller("domainController", ...@@ -211,9 +211,10 @@ myApp.controller("domainController",
e.stopPropagation(); e.stopPropagation();
} }
$scope.searchFilter = function(obj) { $scope.searchFilter = function(obj) {
var re = $scope.searchTerm; var stringToGoIntoTheRegex = $scope.searchTerm;
var filteredWord = !$scope.searchTerm || obj.employeeName.startsWith(re); var regex = new RegExp("^" + stringToGoIntoTheRegex,"i");
return filteredWord; var filteredWord = !$scope.searchTerm || obj.employeeName.match(regex);
return filteredWord;
}; };
$scope.clearSearchTerm = function() { $scope.clearSearchTerm = function() {
$scope.searchTerm = ''; $scope.searchTerm = '';
......
...@@ -277,9 +277,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -277,9 +277,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
e.stopPropagation(); e.stopPropagation();
} }
$scope.searchFilter = function (obj) { $scope.searchFilter = function (obj) {
var re = $scope.searchTerm; var stringToGoIntoTheRegex = $scope.searchTerm;
var filteredWord = !$scope.searchTerm || obj.employeeName.startsWith(re); var regex = new RegExp("^" + stringToGoIntoTheRegex,"i");
return filteredWord; var filteredWord = !$scope.searchTerm || obj.employeeName.match(regex);
return filteredWord;
}; };
......
...@@ -299,9 +299,10 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -299,9 +299,10 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
e.stopPropagation(); e.stopPropagation();
} }
$scope.searchFilter = function (obj) { $scope.searchFilter = function (obj) {
var re = $scope.searchTerm; var stringToGoIntoTheRegex = $scope.searchTerm;
var filteredWord = !$scope.searchTerm || obj.employeeName.startsWith(re); var regex = new RegExp("^" + stringToGoIntoTheRegex,"i");
return filteredWord; ; var filteredWord = !$scope.searchTerm || obj.employeeName.match(regex);
return filteredWord;
}; };
......
...@@ -22,7 +22,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -22,7 +22,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
{field : 'accountName',displayName: 'Account Name', enableColumnMenu: false, enableSorting: false,enableFiltering: true,cellClass: 'grid-align'}, {field : 'accountName',displayName: 'Account Name', enableColumnMenu: false, enableSorting: false,enableFiltering: true,cellClass: 'grid-align'},
{field : 'industryType',displayName: 'Industry Type', enableColumnMenu: false, enableSorting: true,enableFiltering: true,cellClass: 'grid-align'}, {field : 'industryType',displayName: 'Industry Type', enableColumnMenu: false, enableSorting: true,enableFiltering: true,cellClass: 'grid-align'},
{field : 'status',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,cellClass: 'grid-align'}, {field : 'status',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,cellClass: 'grid-align'},
{field : 'deliveryManagers',displayName: 'Account Managers', cellTemplate: '<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>' ,enableColumnMenu: false, enableSorting: true,enableFiltering: false,cellClass: 'grid-align'}, {field : 'deliveryManagers',displayName: 'Delivery Managers', cellTemplate: '<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>' ,enableColumnMenu: false, enableSorting: true,enableFiltering: false,cellClass: 'grid-align'},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:130} {name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:130}
] ]
}; };
...@@ -116,7 +116,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -116,7 +116,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
$scope.accountName; $scope.accountName;
$scope.industryType; $scope.industryType;
$scope.clientAddress; $scope.clientAddress;
$scope.searchTerm; $scope.searchTerm = '';
$scope.templateTitle=dataToPass.action; $scope.templateTitle=dataToPass.action;
$scope.accountValidationMessage=''; $scope.accountValidationMessage='';
$scope.addButtonvisible=false; $scope.addButtonvisible=false;
...@@ -178,9 +178,10 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -178,9 +178,10 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
e.stopPropagation(); e.stopPropagation();
} }
$scope.searchFilter = function (obj) { $scope.searchFilter = function (obj) {
var re = $scope.searchTerm; var stringToGoIntoTheRegex = $scope.searchTerm;
var filteredWord = !$scope.searchTerm || obj.employeeName.startsWith(re); var regex = new RegExp("^" + stringToGoIntoTheRegex,"i");
return filteredWord; var filteredWord = !$scope.searchTerm || obj.employeeName.match(regex);
return filteredWord;
}; };
$scope.removeSelectedLead = function(item){ $scope.removeSelectedLead = function(item){
var index = $scope.managersSelectedList.indexOf(item); var index = $scope.managersSelectedList.indexOf(item);
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<b >Account Managers</b></td> <b >Delivery Managers</b></td>
<td id="lead" colspan="8"> <td id="lead" colspan="8">
<div class="leads-data" ng-show="managersSelectedList.length > 0"> <div class="leads-data" ng-show="managersSelectedList.length > 0">
<div ng-repeat="item in managersSelectedList"> <div ng-repeat="item in managersSelectedList">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment