2
votes

We are using the LiveSearchGrid Panel in ExtJS 4.2.1 similar to the example below, with Pagination. When the user searches for a record in one page, and then goes to another page, the search text field is NOT cleared, and clicking on the next or previous buttons show some random results (which are based the previous search). How can I clear this Search Text Field in the LiveSearchGridPanel?

http://dev.sencha.com/deploy/ext-4.0.1/examples/grid/live-search-grid.html

I looked into the API documentation of LiveSearchGridPanel, but it does not provide an easy handle to the Search Text Field.

1
include some code maybe? what do you mean by another page? shouldn't you be able to just do: searchvalue: null like in initialization?Vogel612
Don't be confused with the pagination. I have a 'pagingtoolbar' as one of my docked items in the Grid. All I am intrested in is how to get an handle to the SearchValue in the LiveSearchGridPanel. I tried this which did not work. Ext.getCmp('LiveSearchGridPanelID').searchValue = nullRavi

1 Answers

2
votes

Add a listener on the beforechange event of the paging toolbar. Something like this:

{
    xtype: 'pagingtoolbar',
    // ...
    listeners: {
        beforechange: function() {
            this.up('grid').down('textfield[name=searchField]').setValue('');
        }
    }
}