gregnb / gregnb/mui-datatables

Add columnSize option as a table options

Open
#1,582 1 comment 10 reactions 0 assignees View on GitHub
community feedback
Dominant language
JavaScript
Stars
2.7k
Forks
905
PR merge metrics
No merged PRs in 30d

Description

**Hi guys,**

*I'm lenon again, and thanks for your effort to share tools, code and solutions to the community*

## Expected Behavior
Add to table options, an option where the size of the column can be set, just like `columnOrder`.

>
> **@Name:** `columnSize`
> **@Type:** `Array`
> **@Description:**
`An array of numbers (column width) indicating the size the columns should be displayed in. By defaults the size is provided by the Columns prop. This option is useful if you'd like to customize the column size or access to column size changed when the resizable event is happend.`
>

*I think this option should be access via the **onColumnResize** event handler, and should be part of the `columnMeta` in the `customHeadLabelRender` and `customHeadRender` handlers*

## Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | `"@material-ui/core": "^4.9.8",` |
| MUI-datatables | ` "mui-datatables": "^3.5.0"` |
| React | ` "react": "^16.13.0"` |
| browser | `Chrome Versión 86.0.4240.183 (Build oficial) (64 bits)` |

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the table options definition, column resizing implementation, and the onColumnResize, customHeadLabelRender, and customHeadRender entry points. Determine how columnSize should initialize widths and expose updated values, then add the option and verify that resizing and the affected metadata handlers report the expected sizes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.