Comments (6)
Thanks, yep I like this idea. This seems like it will be a common problem so it's definitely worth fixing.
One thing I'd like to do with this extension in general is allow users to specify SlickGrid options when they call show_grid, to allow everyone to take full advantage of the flexibility that SlickGrid already provides. Once I get that in place, you'd have a simple workaround for this sort of situation, or any others where the default SlickGrid options that I set in my code are not ideal.
That being said, a big value-add of this extension I think is the fact that the grid works reasonably well by default and there's very little set up. So I think it would also make sense for me to add some logic to automatically determine a reasonable column width based on the page width.
from qgrid.
Hi Tim,
"a big value-add of this extension I think is the fact that the grid works reasonably well by default and there's very little set up" <= Yep!
In my experience with pandas, my data is always larger than what can be fitted on screen, and the default pandas behavior that cuts it off is annoying. Not sure about other people's data sets, but in our case a default setting that automatically resizes the table would be great. It would be in line with what Excel, Matlab and many other tools do out of the box.
from qgrid.
Hi @TimShawver ,
Is this issue in progress?
Thanks @slavi for raising it. I'm quite surprised more people aren't following this.
from qgrid.
Hi @Telson, we have an open PR #23 which will allow people to pass SlickGrid options in to change the behavior of the grid. Specifically that will allow people to set SlickGrid's 'forceFitColumns' option to false to allow a scroll bar to appear (rather than trying to fit all the columns). There was some back and forth and it got forgotten, so thanks for reminding me. I'll resolve the open questions and merge it at some point this week (or maybe over the weekend).
from qgrid.
Hey @TimShawver , Great, Looking forward to it.!
from qgrid.
@Telson and @slavi, I merged a PR today so you now can achieve the desired behavior by setting grid_options like this:
qgrid.set_defaults(grid_options={
'forceFitColumns': False,
'defaultColumnWidth': 150
})
The set_defaults function sets the options for the grid for the lifetime of the kernel. You can also set grid_options for individual grids by passing them in to the show_grid functions, like this:
qgrid.show_grid(spy, remote_js=False, grid_options={
'forceFitColumns': False,
'defaultColumnWidth': 150
})
Use the question mark operator to see the doc strings about these new capabilities:
qgrid.set_defaults?
qgrid.set_grid_option?
qgrid.show_grid?
forceFitColumns and defaultColumnWidth are just two of the SlickGrid options that can be set this way. Here's the full list https://github.com/mleibman/SlickGrid/wiki/Grid-Options
Big thanks to @snth and @ssanderson for this awesome PR. We haven't yet updated our package on PyPI, so if you won't be able to get the updated version with pip yet. I'll do that tomorrow, but until then you'll have to just pull the latest from this repository to get the new capabilities.
from qgrid.
Related Issues (20)
- Set Formatter for Column Definitions
- AttributeError: 'DataFrame' object has no attribute 'map'
- [Security] Workflow main.yml is using vulnerable action actions/checkout
- missing 1 required positional argument: 'widget' HOT 3
- qgrid not working in Binder notebook
- update for ipywidgets 8 compatibility HOT 1
- qgrid post link fails on environment build HOT 2
- REPO IS NO LONGER MAINTAINED AND DOES NOT SUPPORT JUPYTERLAB>=3.0.0 HOT 8
- QGrid is not working with NB-viewer.
- Internet connection required for qgrid 1.1.3 HOT 1
- Here, working version HOT 12
- filter_changed is not recognised in .on() HOT 1
- "ImportError: cannot import name 'Mapping' from 'collections' (C:\ProgramData\anaconda3\lib\collections\__init__.py)"
- post-link script failed for package conda-forge::qgrid-1.3.1-py39hcbf5309_2
- Filter not working HOT 1
- Detecting row selected in Python shiny
- Cannot edit the table using responsive setting
- Introducing QgirdNext: bug fixes and compatibility improvements HOT 1
- Polars Support
- Integrating width VTable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qgrid.