Vanilla JS

ZingGrid has full functionality when using Vanilla JavaScript with no additional frameworks! In this guide, we provide an outline of the web component (markup) implementation of the library and how to manipulate that markup with Vanilla JavaScript. We will be building up to a grid that changes data at a set interval.


  1. Include the following dependencies in your HTML file, like so:

        <script src="path/to/zinggrid.min.js" defer></script>
  2. Create a <zing-grid> component:

  3. Configure your grid through attributes within <zing-grid>. In this example, we'll add the id, theme, caption, data attributes:

          "firstName": "John",
          "lastName": "Doe",
          "age": 45
          "firstName": "Jane",
          "lastName": "Doe",
          "age": 44
      caption="Meet the Doe Family">
  4. Use JavaScript to change your grid data every second:

    const zingGridRef = document.querySelector('#example-grid');
    zingGridRef.executeOnLoad(function() {
      setInterval(function() {
        const newData = [
            firstName: 'John Jr.',
            lastName: 'Doe',
            age: Math.floor(15 * Math.random())
            firstName: 'Jane Jr.',
            lastName: 'Doe',
            age: Math.floor(13 * Math.random())
        zingGridRef.setAttribute('data', JSON.stringify(newData));
      }, 1000);

Vanilla JS Grid with Changing Data

Here is our completed grid which changes the data it displays every second:


[integrations: vanilla JS]