• Edit
  • Download
  • <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid: Simple Grid</title>
      <script nonce="undefined" src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
      <style>
        body {
          background: #e6e6e6;
        }
    
        zing-grid[loading] {
          height: 461px;
        }
      </style>
    </head>
    
    <body>
      <zing-grid caption="ZingGrid Method - filterMenuColumn()" filter filter-menu-areas="both" src="https://cdn.zinggrid.com/datasets/user-roles.json">
      </zing-grid>
      <script>
        ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
        window.addEventListener('load', () => {
          let zgRef = document.querySelector('zing-grid');
          zgRef.executeOnLoad(() => {
            zgRef.filterMenuColumn('name', {
              // By conditions
              conditionals: [{
                condition: 'contains',
                val1: 'Bender'
              }],
              // By selectbox options
              // selectItems: ['Bender Bending Rodriguez'],
              // Indicate to match case
              // matchCase: true,
              // Indicate how to filter multiple conditions (default is 'and')
              // boolean: 'or',
            });
          });
        });
      </script>
    </body>
    
    </html>
    <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid: Simple Grid</title>
      <script src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
    </head>
    
    <body>
      <zing-grid caption="ZingGrid Method - filterMenuColumn()" filter filter-menu-areas="both" src="https://cdn.zinggrid.com/datasets/user-roles.json">
      </zing-grid>
    </body>
    
    </html>
    body {
      background: #e6e6e6;
    }
    window.addEventListener('load', () => {
      let zgRef = document.querySelector('zing-grid');
      zgRef.executeOnLoad(() => {
        zgRef.filterMenuColumn('name', {
          // By conditions
          conditionals: [{
            condition: 'contains',
            val1: 'Bender'
          }],
          // By selectbox options
          // selectItems: ['Bender Bending Rodriguez'],
          // Indicate to match case
          // matchCase: true,
          // Indicate how to filter multiple conditions (default is 'and')
          // boolean: 'or',
        });
      });
    });