ColVis Button Does Not Hide Column Options When Reclicked
ColVis Button Does Not Hide Column Options When Reclicked
ellipsis17
Posts: 4Questions: 0Answers: 0
I would like to have a table like the one on this page:
https://datatables.net/release-datatables/extras/ColVis/index.html
(How the initialization call appears to be so simple in the source is a mystery to me.)
And I have it decently close to right. This fiddle page (http://jsfiddle.net/ellipsis17/CsGA6/) hopefully hopefully makes clear what I am doing. However, there are several issues around the Show / Hide Columns button.
Primarily, when I click it, and it shows the options to display the five columns, it never hides them again. That is, when I reclick Show / Hide Columns, the row of checkboxes is still there.
Also, the button is too small and the row of checkboxes is ill-positioned. But those concerns are secondary.
Per https://datatables.net/extras/colvis/options, the oColVis object has only the following nine options:
activate
aiExclude / exclude
bRestore / restore
buttonText
fnLabel / label
fnStateChange / stateChange
iOverlayFade / overlayFade
sAlign / align
sRestore / restore
So I don't see anything that suggests toggling visibility of column options on each click. But it seems like that would be a default behavior anyway.
Help?
https://datatables.net/release-datatables/extras/ColVis/index.html
(How the initialization call appears to be so simple in the source is a mystery to me.)
And I have it decently close to right. This fiddle page (http://jsfiddle.net/ellipsis17/CsGA6/) hopefully hopefully makes clear what I am doing. However, there are several issues around the Show / Hide Columns button.
Primarily, when I click it, and it shows the options to display the five columns, it never hides them again. That is, when I reclick Show / Hide Columns, the row of checkboxes is still there.
Also, the button is too small and the row of checkboxes is ill-positioned. But those concerns are secondary.
Per https://datatables.net/extras/colvis/options, the oColVis object has only the following nine options:
activate
aiExclude / exclude
bRestore / restore
buttonText
fnLabel / label
fnStateChange / stateChange
iOverlayFade / overlayFade
sAlign / align
sRestore / restore
So I don't see anything that suggests toggling visibility of column options on each click. But it seems like that would be a default behavior anyway.
Help?
This discussion has been closed.
Replies
Are you able to link me to the page you are working on so I can take a look at what is happening? It sounds like there might be a Javascript error on the page when you click on one of the ColVis buttons.
Thanks,
Allan
A workaround that I will try is to add a "Deactivate button", pretty much same as activate on mouseover or click but removes the visibility.
For the second part, you can move around the C in the sDom, that worked for me. move it around and see if any work for you. 'C<"clear">lfrtip', '<"clear">Clfrtip', '<"clear">lfCrtip'
[code]
div.ColVis_catcher {
position: absolute;
z-index: 1101;
}
[/code]
once you fill it in there it works.
Thanks Allen for such amazing software and support!