Mottie jQuery Tablesorter reset button inside table header

358 views Asked by At

I'm using Mottie's Tablesorter, and it's ideal for what I need!

However I can't figure out how (or if it's even possible) to put the "reset search" button inside one of the table headers (where a filter would usually be).

I have a jsfiddle here of it working with the reset button outside of the table: http://jsfiddle.net/OPSJono/1dpd1a6y/4/

This is the part of the JS that determines what goes into the filter table header row. But I can't seem to find a way to put a button in there.

This code currently returns nothing into that cell (as filter_reset doesn't exist)

6: function ($cell, indx) {
                return $.filter_reset;
            }

However I would like the reset button inside the "actions" header.

I've looked around and can't find anyone else who's put the reset button inside of a filter header before.

Any help or a point in the right direction would be appreciated!

1

There are 1 answers

0
OPSJono On

Through trial and error I found a way to do it!!

6 : function($cell, indx) {
            return $cell.html('<button type="button" class="reset">Reset Search</button>');
        }

Just returning HTML code into the Cell.

Seems pretty obvious now that I've figured it out!