jqGrid event handler for clearing filter toolbar textbox
<p>I've done some searching and can't seem to find the solution to my problem here. I need to capture the event that happens when the user clicks the X to clear a textbox input in a jqGrid filter toolbar. I am using free-jqGrid 4.13.1.</p>

<p>Here's the code I'm using to set up my filter toolbar. This is a global method that is used to create the filter toolbar for all jqGrids in my project.</p>

<pre><code>var bindTableFilterToolbar = function (table, selector) {
    table.jqGrid('filterToolbar', {
        defaultSearch: 'cn'
        , ignoreCase: true
        , stringResult: true
        , searchOnEnter: false
        , afterSearch: function () {
            var filteredRows = $('#' + selector + ' tr').filter(':not(.jqgfirstrow)');
            if (filteredRows.length === 1) {
                table.jqGrid('setSelection', filteredRows[0].id);
            }
        }
        , afterClear: function() {
            alert('this does not trigger');
        }
    });
}
</code></pre>

<p>Here's a screenshot to show exactly what I mean.</p>

<p><img src="https://imgur.com/o2lZ3rU.png" alt="Filter Toolbar Image"></p>

<p>For this particular grid, the <code>datatype</code> is set to json but the <code>URL</code> property is set and therefore after the AJAX request, I know it sets to <code>local</code>. I am requesting unfiltered data from the server with <code>loadonce: true</code>.</p>

<p>How do I tie in to the event for the user clicking the X to clear the textbox? I've tried adding the <code>afterClear</code> handler, but that doesn't seem to be firing upon clicking the X. After looking <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:toolbar_searching" rel="nofollow noreferrer">on the trirand wiki for toolbar searching</a> I think that <code>afterClear</code> is for clearing the entire toolbar, which is <em>not</em> what I need.</p>