Skip to content
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

Is there a way to make colvis button work without reset_index() #298

Open
sherry151 opened this issue Jun 22, 2024 · 2 comments
Open

Is there a way to make colvis button work without reset_index() #298

sherry151 opened this issue Jun 22, 2024 · 2 comments

Comments

@sherry151
Copy link

I would really like to have Column visibility work for tables with index columns. Index columns allow for nice formatting using background colors and Pandas styler.

@mwouts
Copy link
Owner

mwouts commented Jun 22, 2024

Hi @sherry151 , there is a JavaScript example for how to do this on the datatable documentation: https://datatables.net/reference/button/colvis

You should be able to port it to ITables - use JavaScriptFunction to define the columnText function as in this example: https://mwouts.github.io/itables/formatting.html#colors-based-on-cell-values

@sherry151
Copy link
Author

I wasn't able to get this working given my limited knowledge of JavaScript. How do I get the column names in JavaScript. I know how to do it in Python but in JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants