Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed visibleColumns method to also allow unset column.hidden property #6

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data-grid.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions data-grid.min.js.map

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The columns must be an array with the following fields:
| **width** | the width of the column (auto otherwise) |
| **class** | class to set on the column (target body or header with th.class or td.class) |
| **attr** | don't render the column and set a matching attribute on the row with the value of the field |
| **hidden** | hide the column |
| **hidden** | hide the column (defaults to false if not set) |

Note : you can also pass a plain list of comma separated string, or a js object with the field => title mapping.

Expand Down Expand Up @@ -228,16 +228,18 @@ You can check `demo-server.html` to get a sample usage with saving functionnalit

## Events

| Name | Trigger |
| -------------------- | ---------------------------- |
| **edit** | A row is edited |
| **action** | An action is performed |
| **connected** | The grid is connected |
| **disconnected** | The grid is disconnected |
| **columnResized** | A column is resized |
| **columnVisibility** | A column is hidden/shown |
| **columnReordered** | A column is dragged |
| **rowsSelected** | Any or all rows are selected |
| Name | Trigger |
| -------------------- | ---------------------------------------- |
| **edit** | A row is edited |
| **action** | An action is performed |
| **connected** | The grid is connected |
| **disconnected** | The grid is disconnected |
| **columnResized** | A column is resized |
| **columnVisibility** | A column is hidden/shown |
| **columnReordered** | A column is dragged |
| **rowsSelected** | Any or all rows are selected |
| **headerRendered** | Column header (thead) render is complete |
| **bodyRendered** | Table body (tbody) render is complete |

## Server

Expand Down
2 changes: 1 addition & 1 deletion src/data-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ class DataGrid extends BaseElement {

visibleColumns() {
return this.options.columns.filter((col) => {
return col.hidden === false;
return !col.hidden;
});
}

Expand Down