koalyptus / TableFilter

A Javascript library making HTML tables filterable and a bit more :)
https://www.tablefilter.com
MIT License
323 stars 95 forks source link

Toggle ColsVisibility behavior to return selected column rather than hide it. #756

Closed canaanmerchant closed 4 years ago

canaanmerchant commented 4 years ago

Enhancement/feature description It would be nice to be able to select a column and have TableFilter return only that column instead of hiding it. There doesn't seem to be any option that lets you change the default behavior.

Why would the enhancement be useful to most users If you're just interested in the data of one or two columns you have to click all of the other columns to hide them. It's a little quicker and more intuitive for some to just click the columns you want to see instead.

Describe alternatives you've considered In the meantime if there's a way to just change the behavior in the colsVisibility.js script itself I'd welcome the help.

I feel like this function inside the colsVisibility.js script is where I could switch what is returned to get the behavior I want but I've had trouble testing it so maybe I'm off base. We're referencing the tableFilter.js under 'Dist' so maybe its something I have to find and change in there.

`/**

TableFilter Version: [Enter TableFilter version here] Browser and version: Version 78.0.3904.97 (Official Build) (64-bit) OS and version: Windows 10 Device: Desktop

koalyptus commented 4 years ago

Hi @canaanmerchant, you are probably interested in the tick_to_hide option which you would set to false. Have a look to the extension settings: https://github.com/koalyptus/TableFilter/wiki/3.4-Columns-visibility and the complete ColVisibility API: https://www.tablefilter.com/docs/class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html