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

Remove filter from certain columns #773

Closed MatanDavidi closed 4 years ago

MatanDavidi commented 4 years ago

Enhancement/feature description It would be really useful if there was a way to specify the indices of the columns for which you do not want the user to be able to filter.

Steps which explain the enhancement/feature

  1. Create a generic object containing the TableFilter object's configuration.
  2. Set a property such as "excluded_cols" to have as a a value an array containing the indices of the columns for which you do not want your users to filter (excluded_cols: [0, 1, 10]).
  3. Pass the generic object as parameter when instantiating the TableFilter object.

Current and suggested behavior As of right now there is no way, to my knowledge, to do such a thing. What this feature would do is show the column without the filterable header. See enclosed image.

Why would the enhancement be useful to most users That would allow a developer to add columns containing notes, information, links, buttons, ... Without having to add them after the table has been initialized.

Screenshots and GIFs image

image

Describe alternatives you've considered One solution I have considered is adding the column after the "init" function has been called using jQuery and manipulating the DOM.

TableFilter Version: 0.6.105 Browser and version: 73.0.1 x64 OS and version: Microsoft Windows 10 Home, Version 10.0.18362 build 18362 Device: HP Pavilion - 15-au147nz

koalyptus commented 4 years ago

Hi @MatanDavidi tx for taking time to submit such a detailed issue, I appreciate! So I think you are looking at this option col_x: 'none', you can see it in this example: http://www.tablefilter.com/filter-types.html