Limit number of checked boxes in ColVis.

Limit number of checked boxes in ColVis.

aliwhitealiwhite Posts: 6Questions: 0Answers: 0
edited August 2013 in Feature requests
Using ColVis, I would like to be able to limit the number of columns that can be visible at any one time by limiting the number of columns that can be checked. Is this an easy fix?

Replies

  • allanallan Posts: 63,488Questions: 1Answers: 10,467 Site admin
    So you would only show the first 5 (for example) columns? How would you access the option to change the visibility of the column columns? Yes it probably is an easy change - just change the loop that ColVis uses to loop over the columns in the table.

    Allan
  • aliwhitealiwhite Posts: 6Questions: 0Answers: 0
    Alan,
    I'm sorry - I meant restrict the number of columns that can be *selected* at any one time. If you can set the limit to 4, then after the 4 check boxes are checked, the fifth attempt either triggers a dialogue box, or nulls the first choice (loop) so that only 4 columns can ever be visible at one time.
    My table has 44+ columns and uses Row Grouping and no scrolling.
  • aliwhitealiwhite Posts: 6Questions: 0Answers: 0
    I'm looking at various javascripts, but just not sure how to implement in ColVis. Am thinking something like "oColVis": {"iCheckMax":4},
    and run a script to count the checkboxes checked and return an alert if more than the set limit either before or as part of ColVis table draw. Does that make sense?
    Thanks Alan.
  • aliwhitealiwhite Posts: 6Questions: 0Answers: 0
    This is what I mean ..http://jsbin.com/ucuha3/1/edit - this version without an alert.
  • allanallan Posts: 63,488Questions: 1Answers: 10,467 Site admin
    Oh I see what you mean. Yes that sounds like it would be a useful addition to ColVis. It isn't possible at the moment though I'm afraid.

    Allan
  • aliwhitealiwhite Posts: 6Questions: 0Answers: 0
    Thanks for your attention on this issue, Allan. Maybe someone else has an idea?
This discussion has been closed.