]> source.dussan.org Git - archiva.git/commitdiff
fix filter on users grid
authorOlivier Lamy <olamy@apache.org>
Wed, 22 Jan 2014 11:39:45 +0000 (11:39 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 22 Jan 2014 11:39:45 +0000 (11:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/2.0.0-RC@1560318 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js

index 2f13804a6cc25f71cc8e35db1de16d57657c3e20..1c83d996799ac394f057537d01e1a5a0d0ceaa84 100644 (file)
@@ -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);
+    });
+
   }
 
   /**