• Edit
  • Download
  • <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid: Blank Grid</title>
      <script nonce="undefined" src="https://cdn.zinggrid.com/dev/zinggrid-dev.min.js"></script>
      <style>
        body {
          background: #e6e6e6;
        }
    
        .yellow {
          background: #fff59d;
        }
    
        .red {
          background: #ef9a9a;
        }
    
        zing-grid[loading] {
          height: 552px;
        }
      </style>
    </head>
    
    <body>
      <!-- Most features can be toggled on the toplevel zing-grid tag -->
      <zing-grid caption="Cell Class Function" col-class="singleColumnClass" layout="row" layout-controls="disabled" viewport-stop>
        <!-- dataset -->
        <zg-data data='[
          	{ "breed": "Cane Corso", "name": "Ziva"},
          	{ "breed": "Pug", "name": "Doug"},
          	{ "breed": "Corgi", "name": "Jenny"},
          	{ "breed": "Pomeranian", "name": "Koda"},
          	{ "breed": "Great Dane", "name": "Zeus"},
          	{ "breed": "Frenchie", "name": "Bruce"},
          	{ "breed": "Cane Corso", "name": "Sofia"},
          	{ "breed": "Pomeranian", "name": "Snowball"}
          ]'></zg-data>
      </zing-grid>
    
      <script>
        ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
    
        function singleColumnClass(index, cellDOMRef, cellRef) {
          if (index === 'name') return 'yellow';
          return 'red';
        }
      </script>
    </body>
    
    </html>
    <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid: Blank Grid</title>
      <script src="https://cdn.zinggrid.com/dev/zinggrid-dev.min.js"></script>
    </head>
    
    <body>
      <!-- Most features can be toggled on the toplevel zing-grid tag -->
      <zing-grid caption="Cell Class Function" col-class="singleColumnClass" layout="row" layout-controls="disabled" viewport-stop>
        <!-- dataset -->
        <zg-data data='[
          	{ "breed": "Cane Corso", "name": "Ziva"},
          	{ "breed": "Pug", "name": "Doug"},
          	{ "breed": "Corgi", "name": "Jenny"},
          	{ "breed": "Pomeranian", "name": "Koda"},
          	{ "breed": "Great Dane", "name": "Zeus"},
          	{ "breed": "Frenchie", "name": "Bruce"},
          	{ "breed": "Cane Corso", "name": "Sofia"},
          	{ "breed": "Pomeranian", "name": "Snowball"}
          ]'></zg-data>
      </zing-grid>
    
    </body>
    
    </html>
    body {
      background: #e6e6e6;
    }
    
    .yellow {
      background: #fff59d;
    }
    
    .red {
      background: #ef9a9a;
    }
    function singleColumnClass(index, cellDOMRef, cellRef) {
      if (index === 'name') return 'yellow';
      return 'red';
    }