reactgrid icon indicating copy to clipboard operation
reactgrid copied to clipboard

Width of column custom does not work in version 5 alpha

Open camux opened this issue 1 year ago • 3 comments

Describe the bug When try set width of column custom does not work in version 5 alpha, we only see in hte inspector 150px, as fixed value you set another value but this not change for example width: 110

Screenshots or gifs

Image

Your environment details

  • Device: desktop
  • OS: Ubuntu 24.04
  • Browser : Firefox

camux avatar Mar 09 '25 21:03 camux

Ok I fix it with this hack in css

.rgGridContent { grid-template-columns: none !important; }

camux avatar Mar 09 '25 22:03 camux

Column width should not be defined by adding the width property to the cell object under props. Instead, it should be set by passing an array to the columns prop of the ReactGrid component:

For example:

const columns = [
  { colIndex: 0, width: 220 },
  { colIndex: 1, width: 220 },
  { colIndex: 2, width: 220 },
  { colIndex: 3, width: 220 },
];

<ReactGrid columns={columns} />

Setting grid-template-columns to none via CSS is not recommended

webloopbox avatar Apr 14 '25 12:04 webloopbox

I have tried the suggestions here.

Overriding grid-template-columns removes all flexibility and you need to know all your column width values beforehand. Although, it was the only way I could get any column width below 150px.

Setting the column width using the width property on columns passed to ReactGrid only works for values over 150px.

I need to go lower than 150px and have been unable to find a way to do that.

Zenairo avatar Apr 25 '25 03:04 Zenairo