Question

I am putting a search field in a gridpanel toolbar like this:

var searchGrid = Ext.create('Ext.grid.Panel', {
    store: searchStore,
    columns: [searchColumns],
    hideHeaders: true,
    tbar: [{
        xtype: 'searchfield',
        store: searchStore
    }],
    listeners: {
        itemclick: function(v,record) {
            // do stuff
        }
    }
});

enter image description here

I would like my search field to extend the full width of the grid. I know that I can add a listener to the grid that will resize the search field whenever the grid size changes, but does anyone know of a config or something cleaner that I missed?

Was it helpful?

Solution

Specify flex: 1 on the field, since the toolbar uses a HBox layout.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top