mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.07k stars 1.26k forks source link

MUI DataGrid does not allow specific styling on columns #4071

Closed careignition-cps closed 2 years ago

careignition-cps commented 2 years ago

Duplicates

Latest version

Current behavior 😯

I am currently doing the following:

const useStyles = makeStyles(() => ({ root: { '& .super-app-theme--header': { backgroundColor: '#ffffff', }, '& .MuiDataGrid-row:nth-child(odd)': { backgroundColor: '#F4F6F8', }, '& .MuiDataGrid-row:nth-child(even)': { backgroundColor: '#ffffff', }, '& .column-theme': { borderLeft: 0, borderRight: 0.1, borderTop: 0, borderBottom: 0, borderColor: '#F4F6F8', borderStyle: 'solid' }, }, }), );

const { data, error } = useFetch(url); if (data !== null) { if (data[0] !== null) { console.log(data[0].data); const { columnData, rowData } = data[0].data; rows = rowData; columns = columnData; } } columns.forEach((column) => { column.cellClassName = 'column-theme' })

The color and the thickness of the border will not change. I have also tried to change them in the inspector, and changing them, ie changing the color for the column-theme, results in no color change. When I set color, the color of every text and the borders change. If there is another way to add lines between columns, for the entire grid, please let me know

Expected behavior 🤔

adding a style of borderColor should, in fact, make the border change colors.

Steps to reproduce 🕹

See code above. Applying the style to my datagrid is not working

Context 🔦

Makes the columns uglier

Your environment 🌎

`npx @mui/envinfo` ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```
flaviendelangle commented 2 years ago

Hi, Thanks for your contribution.

Could you provide a working reproduction, this Codesandbox template might be a good starting point.

careignition-cps commented 2 years ago

Hi, Thanks for your contribution.

Could you provide a working reproduction, this Codesandbox template might be a good starting point.

Yes - apologies. I will do so on thursday (I am currently in a big crunch)

github-actions[bot] commented 2 years ago

Since the issue is missing key information, and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

flaviendelangle commented 2 years ago

Feel free to add a working reproduction when you will have the time even if the issue has been closed :+1: