gregnb / mui-datatables

Datatables for React using Material-UI
MIT License
2.7k stars 931 forks source link

Add columnSize option as a table options #1582

Open carloslenondavis opened 3 years ago

carloslenondavis commented 3 years ago

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)
wdh2100 commented 3 years ago

I think we need to solve both problems together.

https://github.com/gregnb/mui-datatables/issues/1577