Skip to content

Add Dropdown filter #81

@HandyAndyOG

Description

@HandyAndyOG

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions