You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cool! I'm afraid I have not worked out a proper way to do this yet...it's one of the most requested features though so I'm hoping I can find some time to work on it soon. Maybe what I should do is let people pass in a javascript function for formatting the column as you're doing here, but let them do it at the time with qgrid is constructed....
I've also had requests for conditionally rendering ipywidget controls within cells (like buttons, etc), which I think would be really cool but likely more complex to implement, so maybe starting with a js-based solution like you have here would be a good start.
Anyways, sorry I don't have a better answer yet, and thanks for the feedback...it's really helpful to see a concrete example of the types of things people want to be able to do.
In this way, you have are still able to retrieve the grid object from the console via DOM for troubleshooting, but you would also make it easier for people to integrate qgrid with other Javascript code, especially in the case of multiple grid objects per notebook.
Like you said, add the possibility, somewhere like here, to post-process the column specifications: something like
Great suggestions, thanks. I will give those a shot and hopefully include them in an upcoming release. Also if you have time to implement/test them out yourself and open a PR, that might accelerate the process a bit.
Activity
taschini commentedon Mar 7, 2018
My current solution is to set the formatter in Javascript after the QgridWidget has been displayed:
Take for instance the dataframe
which can be rendered as
The custom formatter for column "C" can be specified by
This solution is clearly sub-optimal since it uses a global variable (
window.slick_grid) that I believe you introduced only for trouble-shooting.Do you have any idea on how to achieve the same result in a proper way?
TimShawver commentedon Mar 7, 2018
Cool! I'm afraid I have not worked out a proper way to do this yet...it's one of the most requested features though so I'm hoping I can find some time to work on it soon. Maybe what I should do is let people pass in a javascript function for formatting the column as you're doing here, but let them do it at the time with qgrid is constructed....
I've also had requests for conditionally rendering ipywidget controls within cells (like buttons, etc), which I think would be really cool but likely more complex to implement, so maybe starting with a js-based solution like you have here would be a good start.
Anyways, sorry I don't have a better answer yet, and thanks for the feedback...it's really helpful to see a concrete example of the types of things people want to be able to do.
taschini commentedon Mar 8, 2018
I have two separate suggestions:
Keep a reference to the Slick.Grid object within the DOM element: something like
instead of, or perhaps together with,
In this way, you have are still able to retrieve the grid object from the console via DOM for troubleshooting, but you would also make it easier for people to integrate qgrid with other Javascript code, especially in the case of multiple grid objects per notebook.
Like you said, add the possibility, somewhere like here, to post-process the column specifications: something like
or, perhaps, due to the subtelties of eval,
TimShawver commentedon Mar 8, 2018
Great suggestions, thanks. I will give those a shot and hopefully include them in an upcoming release. Also if you have time to implement/test them out yourself and open a PR, that might accelerate the process a bit.