experiment_id: web-retrieval-v1
fixture_id: /demos/web-component-grid-drag-and-hide-colunns
mode: provenance
representation: html
origin_response_id: 0578245a252e24707aa8b89eb42016d2
version: 2026-10-21
version_created_at_utc: 2026-10-21T20:42:35.565Z
version_nonce: 77a31d929d9ca34781373550439d8dd3
generated_at_utc: 2026-10-25T01:41:29.197Z
response_nonce: 164e8405110d531c667c25eb9d647702

Drag to Hide Columns

68 of 125
You can drag columns off the grid to hide them.
Result Full HTML CSS JS
Edit Download
[[index.breed]] - [[index.name]]

Full Code

<!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>
    zing-grid[loading] {
      height: 517px;
    }
  </style>
</head>

<body class="zg-body">
  <!-- Most features can be toggled on the toplevel zing-grid tag -->
  <zing-grid caption="Drag and hide columns" columns-control column-drag="columns" column-drag-action="hide" layout="row" layout-controls="disabled" viewport-stop>
    <!-- dataset -->
    <zg-data data='[
      	{ "breed": "Cane Corso", "name": "Ziva"},
      	{ "breed": "Pug", "name": "Doug"},
      	{ "breed": "Corgi", "name": "Jenny"},
      	{ "breed": "Pomeranian", "name": "Koda"},
      	{ "breed": "Great Dane", "name": "Zeus"},
      	{ "breed": "Frenchie", "name": "Bruce"},
      	{ "breed": "Cane Corso", "name": "Sofia"},
      	{ "breed": "Pomeranian", "name": "Snowball"}
      ]'></zg-data>
    <!-- If you don't want to use all columns from dataset, user must define columns here -->
    <zg-colgroup>
      <zg-column index="breed" type="select" type-select-options="Cane Corso, Corgi, Frenchie, Great Dane, Pomeranian, Pug"></zg-column>
      <zg-column index="name" filter="disabled"></zg-column>
      <zg-column index="breed, name" header="Combined" filter="disabled">
        <div>[[index.breed]] - [[index.name]]</div>
      </zg-column>
    </zg-colgroup>
  </zing-grid>

  <script>
    ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
  </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 class="zg-body">
    <!-- Most features can be toggled on the toplevel zing-grid tag -->
    <zing-grid
      caption="Drag and hide columns"
      columns-control
      column-drag="columns"
      column-drag-action="hide"
      layout="row"
      layout-controls="disabled"
      viewport-stop>
      <!-- dataset -->
      <zg-data data='[
      	{ "breed": "Cane Corso", "name": "Ziva"},
      	{ "breed": "Pug", "name": "Doug"},
      	{ "breed": "Corgi", "name": "Jenny"},
      	{ "breed": "Pomeranian", "name": "Koda"},
      	{ "breed": "Great Dane", "name": "Zeus"},
      	{ "breed": "Frenchie", "name": "Bruce"},
      	{ "breed": "Cane Corso", "name": "Sofia"},
      	{ "breed": "Pomeranian", "name": "Snowball"}
      ]'></zg-data>
      <!-- If you don't want to use all columns from dataset, user must define columns here -->
      <zg-colgroup>
        <zg-column index="breed" type="select" 
            type-select-options="Cane Corso, Corgi, Frenchie, Great Dane, Pomeranian, Pug"></zg-column>
        <zg-column index="name" filter="disabled"></zg-column>
        <zg-column index="breed, name" header="Combined" filter="disabled">
          <div>[[index.breed]] - [[index.name]]</div>
        </zg-column>
      </zg-colgroup>
    </zing-grid>

  </body>
</html>
/* No CSS styles */
// No JS code

Interested in this demo? Modify it to your needs in ZingSoft Studio, our testing sandbox. It's free to sign up, and you can come back and edit at any time!

Edit in Studio

Demo Gallery