SHARE
TWEET

Untitled

a guest Jul 16th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var gridOptions = {
  2.     defaultColDef: {
  3.         filter: true
  4.     },
  5.     columnDefs: columnDefs,
  6.     rowData: null,
  7.     animateRows: true,
  8.     isExternalFilterPresent: isExternalFilterPresent,
  9.     doesExternalFilterPass: doesExternalFilterPass
  10. };
  11.  
  12. var ageType = 'everyone';
  13.  
  14.     function isExternalFilterPresent() {
  15.     // if ageType is not everyone, then we are filtering
  16.     console.log('test');
  17.     return ageType != 'everyone';
  18. }
  19.  
  20. function doesExternalFilterPass(node) {
  21.  
  22.     console.log(node.data);
  23.     switch (ageType) {
  24.         case 'below30': return node.data.age < 30;
  25.         case 'between30and50': return node.data.age >= 30 && node.data.age <= 50;
  26.         case 'above50': return node.data.age > 50;
  27.         case 'dateAfter2008': return asDate(node.data.date) > new
  28. Date(2008,1,1);
  29.         default: return true;
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top