grid-js / gridjs

Advanced table plugin
https://gridjs.io
MIT License
4.41k stars 242 forks source link

RowSelection Plugin Example does not show checkboxes in Table #1482

Open JosefSommerauer opened 1 week ago

JosefSommerauer commented 1 week ago

I try do get this javascript snipped to work. It shows no error but i also dont see a checkbox element. only a empty column... js code Screenshot 2024-10-18 213157

new gridjs.Grid({
    columns: [
      {
        id: 'myCheckbox',
        name: 'Select',
        plugin: {
          // install the RowSelection plugin
          component: gridjs.plugins.selection.RowSelection
        }
      },
      'Email',
  ],
  data: [
    ["John", "john@example.com"     ],
    ["Mark", "mark@gmail.com"       ],
    ["Eoin", "eoin@gmail.com"       ],
    ["Sarah", "sarahcdd@gmail.com"  ],
    ["Afshin", "afshin@mail.com"    ],
  ],
  sort: true
}).render(document.getElementById("wrapper"));

html code

<!DOCTYPE html>
<html lang="en">
  <head>
    <link
      href="https://unpkg.com/gridjs/dist/theme/mermaid.min.css"
      rel="stylesheet"
    />
  </head>
  <body>
    <div id="wrapper"></div>

    <script src="https://unpkg.com/gridjs/dist/gridjs.umd.js"></script>
    <script src="https://unpkg.com/gridjs/plugins/selection/dist/selection.umd.js"></script>
    <script src="index.js"></script>
  </body>
</html>

<script>

</script>
danielwlogan commented 6 days ago

Duplicate of #1432 ?