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

Hide column at init. table #1133

Closed
airthomas opened this issue Jan 21, 2016 · 4 comments
Closed

Hide column at init. table #1133

airthomas opened this issue Jan 21, 2016 · 4 comments

Comments

@airthomas
Copy link

Hi,
In http://jsfiddle.net/3pS6v/222/, the columns still display. Please help and many thanks.

@Mottie
Copy link
Owner

Mottie commented Jan 21, 2016

Hi @airthomas!

When setting up the column selector, the default setting of columnSelector_mediaquery is true which requires that data-priority attributes are set for each header. Setting it to false allows hidding columns. I'll make this more clear in the documentation.

$(function() {

    $("table").tablesorter({debug: true,
        theme: 'blue',
        widgets: ['columnSelector'],
        widgetOptions : {
            columnSelector_mediaquery: false,
            columnSelector_columns: {
                0: false,
                2: false
            }
        }
    });

});

Also, the demo won't work unless the widget-columnSelector.js file is loaded.

@airthomas
Copy link
Author

Hi Mottie,

I have tried http://jsfiddle.net/Mottie/3pS6v/223/, looks has cache problem, when I change
from
0: false,
2: false
to
0: false,
1: false
it is work, but if change back 0:false, 2:false, it will not work.

@Mottie
Copy link
Owner

Mottie commented Jan 22, 2016

That is happening because the columnSelector_saveColumns option is true (demo).

@airthomas
Copy link
Author

great, many thanks Mottie.

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

No branches or pull requests

2 participants