• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingGrid Demo</title>
    7. <script nonce="undefined" src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
    8. <style>
    9. html,
    10. body {
    11. height: 100%;
    12. width: 100%;
    13. margin: 0;
    14. padding: 0;
    15. }
    16.  
    17. zg-caption h1 {
    18. font-size: 2rem;
    19. }
    20.  
    21. zg-caption p {
    22. font-size: 1rem;
    23. }
    24.  
    25. zg-head {
    26. font-size: 1.3rem;
    27. }
    28.  
    29. zing-grid[loading] {
    30. height: 445px;
    31. }
    32. </style>
    33. </head>
    34.  
    35. <body>
    36. <zing-grid filter="both" filter-menu-areas="both">
    37. <zg-data>
    38. <zg-param name="src" value="https://zingsoft-filter-function.glitch.me/api"></zg-param>
    39. <zg-param name="loadByPage" value="true"></zg-param>
    40. <zg-param name="serverFilter" value="true"></zg-param>
    41. <zg-param name="filterFunction" value="createFilterURL"></zg-param>
    42. </zg-data>
    43. </zing-grid>
    44.  
    45. <script>
    46. ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']); // Builds url for filtering
    47. function createFilterURL(oFilter) {
    48. // Returns a URL query string
    49. return `?filter=${encodeURIComponent(JSON.stringify(oFilter))}`;
    50. // Or an object as name/pair value
    51. // return {filter: JSON.stringify(oFilter)}
    52. };
    53. </script>
    54. </body>
    55.  
    56. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingGrid Demo</title>
    7. <script src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
    8. </head>
    9.  
    10. <body>
    11. <zing-grid filter="both" filter-menu-areas="both">
    12. <zg-data>
    13. <zg-param name="src" value="https://zingsoft-filter-function.glitch.me/api"></zg-param>
    14. <zg-param name="loadByPage" value="true"></zg-param>
    15. <zg-param name="serverFilter" value="true"></zg-param>
    16. <zg-param name="filterFunction" value="createFilterURL"></zg-param>
    17. </zg-data>
    18. </zing-grid>
    19.  
    20. </body>
    21.  
    22. </html>
    1. html,
    2. body {
    3. height: 100%;
    4. width: 100%;
    5. margin: 0;
    6. padding: 0;
    7. }
    8.  
    9. zg-caption h1 {
    10. font-size: 2rem;
    11. }
    12.  
    13. zg-caption p {
    14. font-size: 1rem;
    15. }
    16.  
    17. zg-head {
    18. font-size: 1.3rem;
    19. }
    1. // Builds url for filtering
    2. function createFilterURL(oFilter) {
    3. // Returns a URL query string
    4. return `?filter=${encodeURIComponent(JSON.stringify(oFilter))}`;
    5. // Or an object as name/pair value
    6. // return {filter: JSON.stringify(oFilter)}
    7. };