Removing column filters with a Clear button or link

Removing column filters with a Clear button or link

gormanvjgormanvj Posts: 1Questions: 1Answers: 0

I have a client who wants column filtering which we implemented. They would like us to add a Clear button or link to remove the values entered all at once. I am clearing the oSetting search fields like so for each column.

        var oTable = $('#myDataTable').dataTable();
        var oSettings = oTable.fnSettings();

        oSettings.aoPreSearchCols[1].sSearch = "";
        $("thead input")[0].value = "";

The values disappear but how do call the full table now that the filters are empty? And is the correct method for clearing the fields. My solution does not appear to stick.

Yes, I am fairly new to DataTables

Thanks, Vern

This discussion has been closed.