From 28295ea9cf470b4dc18731b02897ff1febd7a6f2 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 8 Feb 2014 12:01:52 +0000 Subject: [PATCH] fix filter on users grid git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1565987 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/redback/users.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js index 2f13804a6..1c83d9967 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js @@ -287,9 +287,22 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid,typeahead) { founds.push(user[property]()); } }); + //var filteredHeader = ; $("#main-content").find("#users-grid-filter-auto-"+property ).typeahead({ - local: founds + local: founds, + name: 'users-'+property+'-'+$.now() }); + $("#main-content").find("#users-grid-filter-auto-"+property ).on('typeahead:selected', function(obj, datum) { + var users=[]; + + $(usersViewModel.users()).each(function(idx,user){ + if(user[property] && user[property]() && user[property]().indexOf(datum.value)>=0){ + users.push(user); + } + }); + usersViewModel.users(users); + }); + } /**