Selection plugin not working after update
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:
`
<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>
new gridjs.Grid({
columns: [
{
name: 'Details',
plugin: { component: gridjs.plugins.selection.RowSelection }
},
{ name: 'Name' },
{ name: 'email' }
],
data: [
{ name: 'John', email: '[email protected]' },
{ name: 'Mark', email: '[email protected]' },
{ name: 'Eoin', email: '[email protected]' },
{ name: 'Nisen', email: '[email protected]' }
]
}).render(document.getElementById("wrapper"));
</script>
`
Expected behavior I would expect a grid with three columns and the left most column to be a series of check boxes
Screenshots
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
Replacing the gridjs call with <script src="https://unpkg.com/[email protected]/dist/gridjs.umd.js"></script> makes the check boxes appear.
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({
any updates?
Hi. Any updates on this?
Is there any other way to use selection plugin on Vue? I have same issue.
https://codepen.io/zoeleee/pen/QWReKVO same issue
It's ok on ver 6.1.1