Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dropdown filter #81

Open
HandyAndyOG opened this issue Apr 8, 2021 · 0 comments
Open

Add Dropdown filter #81

HandyAndyOG opened this issue Apr 8, 2021 · 0 comments

Comments

@HandyAndyOG
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant