built in search field broke datatables when used in a just unhidden column

built in search field broke datatables when used in a just unhidden column

kaluosikaluosi Posts: 19Questions: 6Answers: 0

1.- We have a Datatable getting data from a server, with some visible columns and some hidden columns.
2.- All columns have a built in search field to filter rows.
3.- Then I use some search fields to filter the results. Every thing works as expected.
4.- Then I unhide some previosly hidden column. Every thing works as expected.
5.- Then I try to use the built in search field of this unhidden column and this column is populated by the contents of the next column. In other words, if I unhide column 4 and then try to filter by this column, column 4 is populated by the content of column 5 and column 5 keeps the proper value.

Is there any thing I am forgetting to switch off or on??

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @kaluosi ,

    DataTables searches hidden columns in the same way it searches visible ones, so there is likely something else going on with your config.

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    Not sure exactly how you are hiding and unhiding the columns nor how you are building the column select searches. My suggestion would be to build the select inputs with all the columns visible then hide the desired columns using columns().visible().

    Kevin

This discussion has been closed.