Giter VIP home page Giter VIP logo

Comments (6)

TimShawver avatar TimShawver commented on July 18, 2024

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.

slavi avatar slavi commented on July 18, 2024

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.

tlelson avatar tlelson commented on July 18, 2024

Hi @TimShawver ,
Is this issue in progress?
Thanks @slavi for raising it. I'm quite surprised more people aren't following this.

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

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.

tlelson avatar tlelson commented on July 18, 2024

Hey @TimShawver , Great, Looking forward to it.!

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.