• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingGrid: Blank Grid</title>
    7. <script nonce="undefined" src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
    8. <style>
    9. body {
    10. background: #e6e6e6;
    11. }
    12.  
    13. zing-grid[loading] {
    14. height: 668px;
    15. }
    16. </style>
    17. </head>
    18.  
    19. <body>
    20. <zing-grid editor caption="Movies" search pager page-size="10">
    21. <zg-data src="https://zinggrid-examples.firebaseio.com/movies/" adapter="customFirebaseAdapter"></zg-data>
    22. </zing-grid>
    23. <script>
    24. ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
    25. window.addEventListener('load', function() {
    26. // define customFirebaseAdapter
    27. const customFirebaseAdapter = {
    28. startAtKey: 'startAt',
    29. limitToKey: 'limitToFirst',
    30. sortByKey: 'orderBy',
    31. searchKey: 'equalTo',
    32. startAtValue: true,
    33. addValueQuotes: true,
    34. // firebase requires quotes around sort values
    35. sortBy: '"title"',
    36. };
    37.  
    38. ZingGrid.registerAdapter('customFirebaseAdapter', customFirebaseAdapter);
    39.  
    40.  
    41. });
    42. </script>
    43. </body>
    44.  
    45. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingGrid: Blank Grid</title>
    7. <script src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
    8. </head>
    9.  
    10. <body>
    11. <zing-grid editor caption="Movies" search pager page-size="10">
    12. <zg-data src="https://zinggrid-examples.firebaseio.com/movies/" adapter="customFirebaseAdapter"></zg-data>
    13. </zing-grid>
    14. </body>
    15.  
    16. </html>
    1. body {
    2. background: #e6e6e6;
    3. }
    1. window.addEventListener('load', function() {
    2. // define customFirebaseAdapter
    3. const customFirebaseAdapter = {
    4. startAtKey: 'startAt',
    5. limitToKey: 'limitToFirst',
    6. sortByKey: 'orderBy',
    7. searchKey: 'equalTo',
    8. startAtValue: true,
    9. addValueQuotes: true,
    10. // firebase requires quotes around sort values
    11. sortBy: '"title"',
    12. };
    13.  
    14. ZingGrid.registerAdapter('customFirebaseAdapter', customFirebaseAdapter);
    15.  
    16.  
    17. });