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

RFC: columnSelector_columns initial visibility set in html #519

Closed
c00 opened this issue Feb 28, 2014 · 1 comment
Closed

RFC: columnSelector_columns initial visibility set in html #519

c00 opened this issue Feb 28, 2014 · 1 comment

Comments

@c00
Copy link

c00 commented Feb 28, 2014

Concerning the columnselector widget, it would be great to be able to hide a column initially based on an attribute.

Other options are already available this way (like setting the priority and displayname of columns), however this option can now only be set by something along the lines of:

widgetOptions : {
  columnSelector_columns : {
    0 : false,    /* start with column hidden */
    1 : false,     /* start with column hidden */
    2 : true,      /* start with column visible; default for undefined columns */
  }
}

I would love to have the option in my table head like

<th data-priority='2' data-column-visible='0'>Invisible!</th>

(I wish I had any skill in javascript, I'd do it myself)

@Mottie
Copy link
Owner

Mottie commented Mar 1, 2014

Hi @c00!

Thanks! I didn't realize I just threw in the data-columnSelector="false" methods (ref) without making it match the columnSelector_columns option.

So, in the next update you can use any of the following methods in order of priority (set to true, false or disable):

  • jQuery data data-columnSelector="true", data-columnSelector="false" or data-columnSelector="disable".
  • metadata class="{ columnSelector : true }", class="{ columnSelector : false }" or class="{ columnSelector : disable }".
  • headers option headers : { 0 : { columnSelector: true } }, headers : { 0 : { columnSelector: false } } or headers : { 0 : { columnSelector: disable } }.
  • header class name class="columnSelector-true", class="columnSelector-false" or class="columnSelector-disable".

@Mottie Mottie added the Widget label Mar 4, 2014
@Mottie Mottie closed this as completed in cfd2eab Mar 7, 2014
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