-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grid.auto_fit_columns not working #302
Comments
Hello @joseberlines , I tested this functionality locally and it appears to be working fine. Can you check your installation, perhaps you're on an older version? |
@joseberlines can you check the browser console and let me know if you see any errors there? |
I will report soon. we have ipydatagrid in a JupyterHub environement and indeed the version currently is not the last one. |
Hi @ibdafna code gist: What I find strange: b) Since wraptext = True I would expect al least to go over several lines WITHIN a cell. Putting info all together (and even if I am mixing up two things here)
This would be pretty much like Excel and it would be a great enhancement. Moreover, in the above code I made the rows bigger as this: And the way autofit columns works together with wrap text is puzzeling. but following instructions there I thought the wrapping would be working. Please let me know if you need/want more information or insights regarding my explanation |
I can reproduce this easily by copying the code from the example notebook posted above, and adjusting the column contents to long values instead of the given short values. @ibdafna The GIF you showed shows resizing only by the column headers. The problem is when wanting to resize by the column contents. I'm using version 1.1.11 and I don't see any errors in the console. Thanks! |
(Perhaps this is simply a missing feature) |
@matangover Okay, yes, the auto sizing works only based on the columns, not the cells. I misunderstood the question. @joseberlines looking at your screenshot, you have the |
@ibdafna, would it be possible to have some sort of option that will allow auto-adjusting the length of the columns based on the content rather than the column headers? Effectively, I'm looking for what you get in Excel when double clicking the line that splits two adjacent rows in Excel. At first, this can be provided through a programmatic API, but ideally, it would be great to auto-adjust the length by double clicking on the GUI. I could start implementing this myself if you don't morally disagree with the change. |
Added jupyterlab/lumino#546 that implements the functionality described in this. |
jupyterlab/lumino#546 is now released in JupyterLab https://github.com/jupyterlab/jupyterlab/releases/tag/v4.0.5 . I think we can now close this issue. |
Closing as it's now possible to double click on the column separators to auto-fit content, thanks a lot @vthemelis ! |
I got the code from the example related to auto_fit_columns and I get the following:
As you see the code is the same as in:
https://github.com/bloomberg/ipydatagrid/blob/main/examples/Column%20Width%20Auto-Fit.ipynb
but I changed just one line to make the words langer.
The result is that applying:
grid.auto_fit_columns = True
does not change anything and the content of the cells is cut as if nothing would have been changed.
Some idea what I am doing wrong?
THIS IS WHAT i WOULD HAE EXPECTED:
thanks
The text was updated successfully, but these errors were encountered: