question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On resize, Column Width Function only called with index: 0

See original GitHub issue

See: Sandbox

So I had this working yesterday but somehow broke it during a refactor. I’m building a replacement for Table & Column using MultiGrid. Because I have zebra striped rows, one requirement I have is to be able to add an invisible column to fill the remaining space. Upon resizing the window, the calculateColumnWidth function passed to MultiGrid is only called for index zero. You can confirm this by looking at the logs, which look something like this:

screen shot 2017-11-01 at 12 29 37 pm

Here is the behavior I had working yesterday: out

I don’t really want to force update the grids every render, I feel as though changing the width prop should handle that for me.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mballonicommented, Dec 19, 2018

In the end I’ve managed to make it working using “recomputeGridSize” at the AutoSizer event. Thanks!

0reactions
MrNicecommented, Dec 18, 2018

I’ve moved on from that position and no longer have access to the code, but my solution waited 500 ms after the final browser resize event to call one of the force calculate methods on Multigrid

On Tue, Dec 18, 2018, 11:29 AM Marcelo Balloni <notifications@github.com wrote:

Hi @MrNice https://github.com/MrNice , how did you manage to get the desired behavior ? @bvaughn https://github.com/bvaughn Considering this specific use case, what would be the proper manner to deal with window resize using the AutoSizer and MultiGrid? I’ve tried using the same strategy with a function, just as @MrNice https://github.com/MrNice did, however the function is being invoked only at the first rendering. Should I invoke recomputeGridSize?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bvaughn/react-virtualized/issues/864#issuecomment-448340864, or mute the thread https://github.com/notifications/unsubscribe-auth/ACd6x8_9R2dXsbl131Q2rDdOitvnuaOBks5u6UIdgaJpZM4QOtr0 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Column Sizing - JavaScript Data Grid
Function. Sets columns to adjust in size to fit the grid horizontally. ... to further restrain the columns resulting width from that function...
Read more >
Why is my HTML table not respecting my CSS column width?
The best way to set your column widths (td's) is to use a table header (th's). ... min-width:1020px; display: block; overflow: visible; z-index:...
Read more >
column-width - CSS: Cascading Style Sheets - MDN Web Docs
The column-width CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit ......
Read more >
How to change and AutoFit column width in Excel - Ablebits
On an Excel spreadsheet, you can set a column width of 0 to 255, ... the width of a column by using a...
Read more >
Column Resizing in JavaScript (ES5) Grid control - Syncfusion
Column width can be resized by clicking and dragging the right edge of the column header. While dragging, the width of the respective...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found