• Edit
  • Download
  • <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid Demo</title>
      <script nonce="undefined" src="https://cdn.zinggrid.com/dev/zinggrid-dev.min.js"></script>
      <style>
        html,
        body {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
        }
    
        zg-caption h1 {
          font-size: 2rem;
        }
    
        zg-caption p {
          font-size: 1rem;
        }
    
        zg-head {
          font-size: 1.3rem;
        }
    
        zing-grid[loading] {
          height: 1256px;
        }
      </style>
    </head>
    
    <body>
      <h3>`[loadByPage]` indicates that each page of data is retrieved from server.</h3>
      <zing-grid caption="Example Rick and Morty Grid" pager search sort>
        <!-- If you don't want to use all columns from dataset, user must define columns here -->
        <zg-colgroup>
          <zg-column index="name" header="Character Name"></zg-column>
          <zg-column index="status" header="Status"></zg-column>
          <zg-column index="species" header="Species"></zg-column>
        </zg-colgroup>
        <zg-data>
          <zg-param name="countPath" value="info.count"></zg-param>
          <zg-param name="loadByPage" value="true"></zg-param>
          <zg-param name="pageKey" value="page"></zg-param>
          <zg-param name="nextPath" value="info.next"></zg-param>
          <zg-param name="prevPath" value="info.prev"></zg-param>
          <zg-param name="recordPath" value="results"></zg-param>
          <zg-param name="src" value="https://rickandmortyapi.com/api/character/"></zg-param>
        </zg-data>
      </zing-grid>
      <script>
        ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
      </script>
    </body>
    
    </html>
    <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid Demo</title>
      <script src="https://cdn.zinggrid.com/dev/zinggrid-dev.min.js"></script>
    </head>
    
    <body>
      <h3>`[loadByPage]` indicates that each page of data is retrieved from server.</h3>
      <zing-grid caption="Example Rick and Morty Grid" pager search sort>
        <!-- If you don't want to use all columns from dataset, user must define columns here -->
        <zg-colgroup>
          <zg-column index="name" header="Character Name"></zg-column>
          <zg-column index="status" header="Status"></zg-column>
          <zg-column index="species" header="Species"></zg-column>
        </zg-colgroup>
        <zg-data>
          <zg-param name="countPath" value="info.count"></zg-param>
          <zg-param name="loadByPage" value="true"></zg-param>
          <zg-param name="pageKey" value="page"></zg-param>
          <zg-param name="nextPath" value="info.next"></zg-param>
          <zg-param name="prevPath" value="info.prev"></zg-param>
          <zg-param name="recordPath" value="results"></zg-param>
          <zg-param name="src" value="https://rickandmortyapi.com/api/character/"></zg-param>
        </zg-data>
      </zing-grid>
    </body>
    
    </html>
    html,
    body {
      height: 100%;
      width: 100%;
      margin: 0;
      padding: 0;
    }
    
    zg-caption h1 {
      font-size: 2rem;
    }
    
    zg-caption p {
      font-size: 1rem;
    }
    
    zg-head {
      font-size: 1.3rem;
    }