grid-js / gridjs

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

Selection plugin not working after update #1432

Open danielwlogan opened 7 months ago

danielwlogan commented 7 months ago

Describe the bug After the update (6.2.0), the Selection plugin no longer produces the check boxes. Prior to this update the plugin could be used without installation.

To Reproduce Here is a small section of code that demonstrates the missing check boxes:

`<!DOCTYPE html>

` **Expected behavior** I would expect a grid with three columns and the left most column to be a series of check boxes **Screenshots** ![image](https://github.com/grid-js/gridjs/assets/16157159/8ed9a2b2-a986-41ff-ac47-afaa23fda75b) **Desktop (please complete the following information):** - OS: Windows 10 - Browser: Microsoft Edge - Version: 122.0.2365.52 (Official build) (64-bit) **Additional context** The code was working on 2024-03-01
danielwlogan commented 7 months ago

Replacing the gridjs call with <script src="https://unpkg.com/gridjs@6.1.1/dist/gridjs.umd.js"></script> makes the check boxes appear.

nezetic commented 7 months ago

There's indeed a regression in 6.2.0.

The plugin list is cleared after the header config is parsed.

This patch seems enough to fix the issue.

diff --git a/src/config.ts b/src/config.ts
index 86bdbc6..92adae9 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -149,6 +149,9 @@ export class Config {
       });
     }

+    // clear existing plugins list to prevent duplicate errors
+    config.plugin = new PluginManager();
+
     // Header
     config.assign({
       header: Header.createFromConfig(config),
@@ -167,9 +170,6 @@ export class Config {
       translator: new Translator(config.language),
     });

-    // clear existing plugins list to prevent duplicate errors
-    config.plugin = new PluginManager();
-
     if (config.search) {
       // Search
       config.plugin.add({
vladgabor13 commented 5 months ago

any updates?

JorgenEngenNapstad commented 4 months ago

Hi. Any updates on this?

IzerkT commented 4 months ago

Is there any other way to use selection plugin on Vue? I have same issue.

ZoeLeee commented 3 months ago

https://codepen.io/zoeleee/pen/QWReKVO same issue

ZoeLeee commented 2 months ago

It's ok on ver 6.1.1