Hi all,

I'm making use of the fantastic Search Plugin by Saki. Until now I have been adding it as follows to the bottom pager of my Grid, within the initComponent function, so the search box appears once the Grid is rendered. No problem with this:

Code:
   // configure the searchBox plugin
    searchBoxPlugin = new Ext.ux.grid.Search({
				iconCls:'icon-zoom'
				,align: 'right'
				,width: 150
				,readonlyIndexes:['note']
				,disableIndexes:['pctChange', 'id', 'data_entrevista','subdistrito','suco','aldeia']
				,checkIndexes: 'all'
				,minChars:2
				,autoFocus:false
				,showSelectAll:false
				,searchText: 'Buka'
			});

//add the plugin to the grid's pager toolbar
    if (!gridReports.plugins) gridReports.plugins = [];
    gridReports.plugins.push(searchBoxPlugin);
    searchBoxPlugin.init(gridReports);
Now what I want is to add the search box to the toolbar, but only when the user clicks a button, so I thought of using the code above within the button handler function as follows:

Code:
	
// this is my handler
addSearchHandler = function(){
// configure the searchBox plugin
searchBoxPlugin = new Ext.ux.grid.Search({
iconCls:'icon-zoom'
,align: 'right'
,width: 150
,readonlyIndexes:['note']
,disableIndexes:['pctChange', 'id', 'data_entrevista','subdistrito','suco','aldeia']
,checkIndexes: 'all'
,minChars:2
,autoFocus:false
,showSelectAll:false
,searchText: 'Buka'
});
//add the plugin to the grid
if (!gridReports.plugins) gridReports.plugins = [];
gridReports.plugins.push(searchBoxPlugin);
searchBoxPlugin.init(gridReports);
}; // add handler to button btnAddSearch.setHandler(addSearchHandler);
But it doesn't work (it does not issue any error either). I guess I should 'refresh' or 're-render' the toolbar and/or the Grid somewhere in the handler function...but I don't know exactly how to do it. Any hints? Thanks.