• Edit
  • Download
  • <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid: Blank Grid</title>
      <script nonce="undefined" src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
      <style>
        body {
          background: #e6e6e6;
        }
    
        zing-grid[loading] {
          height: 668px;
        }
      </style>
    </head>
    
    <body>
      <zing-grid editor caption="Movies" search pager page-size="10">
        <zg-data src="https://zinggrid-examples.firebaseio.com/movies/" adapter="customFirebaseAdapter"></zg-data>
      </zing-grid>
      <script>
        ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
        window.addEventListener('load', function() {
          // define customFirebaseAdapter
          const customFirebaseAdapter = {
            startAtKey: 'startAt',
            limitToKey: 'limitToFirst',
            sortByKey: 'orderBy',
            searchKey: 'equalTo',
            startAtValue: true,
            addValueQuotes: true,
            // firebase requires quotes around sort values
            sortBy: '"title"',
          };
    
          ZingGrid.registerAdapter('customFirebaseAdapter', customFirebaseAdapter);
    
    
        });
      </script>
    </body>
    
    </html>
    <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid: Blank Grid</title>
      <script src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
    </head>
    
    <body>
      <zing-grid editor caption="Movies" search pager page-size="10">
        <zg-data src="https://zinggrid-examples.firebaseio.com/movies/" adapter="customFirebaseAdapter"></zg-data>
      </zing-grid>
    </body>
    
    </html>
    body {
      background: #e6e6e6;
    }
    window.addEventListener('load', function() {
      // define customFirebaseAdapter
      const customFirebaseAdapter = {
        startAtKey: 'startAt',
        limitToKey: 'limitToFirst',
        sortByKey: 'orderBy',
        searchKey: 'equalTo',
        startAtValue: true,
        addValueQuotes: true,
        // firebase requires quotes around sort values
        sortBy: '"title"',
      };
    
      ZingGrid.registerAdapter('customFirebaseAdapter', customFirebaseAdapter);
    
    
    });