• 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>
      <button id="reset">Reset filter</button>
      <zing-grid caption="ZingGrid Method - resetFilter()" filter src="https://cdn.zinggrid.com/datasets/user-roles.json">
      </zing-grid>
      <script>
        ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
        window.addEventListener('load', () => {
          // Reset filter
          const btnRef = document.getElementById('reset');
          btnRef.addEventListener('click', () => {
            zgRef.resetFilter();
          });
          const zgRef = document.querySelector('zing-grid');
          zgRef.executeOnLoad(() => {
            // Filter 'name' column for term 'Bender'
            zgRef.filterColumn('name', 'Bender');
          });
        });
      </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>
      <button id="reset">Reset filter</button>
      <zing-grid caption="ZingGrid Method - resetFilter()" filter src="https://cdn.zinggrid.com/datasets/user-roles.json">
      </zing-grid>
    </body>
    
    </html>
    body {
      background: #e6e6e6;
    }
    window.addEventListener('load', () => {
      // Reset filter
      const btnRef = document.getElementById('reset');
      btnRef.addEventListener('click', () => {
        zgRef.resetFilter();
      });
      const zgRef = document.querySelector('zing-grid');
      zgRef.executeOnLoad(() => {
        // Filter 'name' column for term 'Bender'
        zgRef.filterColumn('name', 'Bender');
      });
    });