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

DataTables visible columns #21

Open
alzmcr opened this issue Dec 8, 2015 · 1 comment
Open

DataTables visible columns #21

alzmcr opened this issue Dec 8, 2015 · 1 comment

Comments

@alzmcr
Copy link

alzmcr commented Dec 8, 2015

Hey - first of all thanks for kicking this off!

I'm actually playing with it, and I wonder if there is an option to hide a column in data table. I know you can using the visible option https://datatables.net/reference/option/columns.visible but I can't get to make it work with pyxley.

I know this isn't the best place to post request for support, but I haven't found any where else to go!

Thanks!

@nmkridler
Copy link
Contributor

Sorry for the late reply. You can actually hide columns using the initComplete keyword. You can pass it a javascript function to run after the table is initialized like in the DataTables example.

Something like

    init_func = (
        """
        var api = this.api();
        api.column(0).visible(false);
        """)

When you pass that to the DataTables constructor it sends it through to the React code as a string. The javascript then turns the string into a function and executes it after the table initializes.

Hope this helps.

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