Disable search when using fnSetColumnVis()?
Disable search when using fnSetColumnVis()?
First off - thank you for your amazing plugin! It is truly remarkable!
I'm working with version.5.0 beta 11. Since my table is large, I have a series of checkboxes so users can toggle the visibility of the columns. I'm using the fnSetColumnVis() function for this. However, when a column of data is hidden, I don't want it searchable. Is there anyway I can toggle bSearchable in addition to the visibility?
Best regards,
Christina
I'm working with version.5.0 beta 11. Since my table is large, I have a series of checkboxes so users can toggle the visibility of the columns. I'm using the fnSetColumnVis() function for this. However, when a column of data is hidden, I don't want it searchable. Is there anyway I can toggle bSearchable in addition to the visibility?
Best regards,
Christina
This discussion has been closed.
Replies
Just having the column as hidden doesn't stop them from being searchable, as you are seeing. You'll need to set the bSearchable property for the column in question (use aoColumn[index].bSearchable). Following that you'll need to rebuilt the search array. Easiest way to do that is to call fnDraw().
Regards,
Allan
Thanks.
[code]
"oColVis": {
"fnStateChange": function( iColumn, bVisible ) {
report.dataTableSettings[ 0 ].aoColumns[ iColumn ].bSearchable = bVisible;
}
}
[/code]
Allan