select row from CRM results by clicking on it
[APKPM.git] / templates / user.html.ep
index ee02286..ec3364b 100644 (file)
             }
             return keys;
       };
+
+       this.select = function(crm) {
+               console.log( crm );
+               self.selected_username = crm.USERNAME;
+       };
+
+       this.selected_username = '';
+
     }
 
     CRM.$inject = ['$xhr'];
@@ -63,14 +71,18 @@ Add columns:
     <tr>
        <th ng:repeat="c in columns" ng:click="columns.$remove(c)">{{c}}</th>
     </tr>
-    <tr ng:repeat="u in response">
-       <td ng:repeat="c in columns">{{u[c]}}</td>
+    <tr ng:repeat="u in response" ng:click="select(u)">
+       <td ng:repeat="c in columns" ng:show="! selected_username || selected_username == u.USERNAME">{{u[c]}}</td>
     </tr>
     </table>
+
+    <input type=button value="Show ALL results, not just {{selected_username}}" ng:click="selected_username=''" ng:show="selected_username">
+
     <input type=checkbox name=debug value=1>
     <pre ng:show=debug>
 url={{url}}
 code={{code}}
 response={{response}}
+username={{username}}
     </pre>
   </div>