gregnb / gregnb/mui-datatables

`print: false` column option is not working

Open
#1,913 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

## Expected Behavior
Table column should be hidden when printing if its `print` option is set to `false` (see [docs](https://github.com/gregnb/mui-datatables#column-options))

## Current Behavior
Setting `print` option to `false` has no effect, the column is visible when printing.

## Steps to Reproduce (for bugs)
This bug can be reproduced on codesandbox where all examples are located.
1. Go to https://codesandbox.io/s/github/gregnb/mui-datatables mentioned in the README
2. Select "Hide Columns Print" example
3. See how the table has 4 columns: Modified Title Label, Location, Age, Salary
4. Click "Print" button
5. See all 4 columns present in the print view, while according to the example [source](https://github.com/gregnb/mui-datatables/blob/b8d2eee6af4589d254b40918e5d7e70b1ee4baca/examples/hide-columns-print/index.js#L27) both Location and Age columns should've been hidden.
Screenshot 2022-04-20 at 21 58 53

## Your Environment
I am pretty sure this is related to this issue: https://github.com/gregnb/mui-datatables/issues/1886#issuecomment-1104304846, and was introduced during the move to `tss-react`: the CSS responsible for hiding the columns isn't properly created, causing the bug.

| Tech | Version |
|--------------|---------|
| MUI-datatables | 4.2.0 |
| browser | Chrome |

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with examples/hide-columns-print/index.js and reproduce the issue in the linked CodeSandbox using the documented column options. Compare the example's expected print view with the current output and verify that the Location and Age columns are hidden when printing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.