csv-to-html-table icon indicating copy to clipboard operation
csv-to-html-table copied to clipboard

Add Dropdown filter

Open HandyAndyOG opened this issue 5 years ago • 0 comments

Hi, Thank you so much for this table generator, I am currently integrating this into my first website!

I am currently trying to add a dropdown filter to filter the data within my table. The issue I am facing is that the javascript cannot sort the data, as it can't "see" the table headers and therefore filter. I was thinking of adding the filtering javascript to the "csv-to-html.js" file, but that doesn't seem to work for me.

Any help would be greatly appreciated.

Below is my basic filtering code.

`var table = table = $('#TableLD').DataTable();

            $('#Shape').on('change', function () {
                    table.columns(1).search( this.value).draw();
            } );

            $('#Colour').on('change', function () {
                   table.columns(2).search( this.value).draw();
            } );`

Kind Regards

HandyAndyOG avatar Apr 08 '21 09:04 HandyAndyOG