2

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?

egerardus
  • 11,316
  • 12
  • 80
  • 123

1 Answers1

4

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

Evan Trimboli
  • 29,900
  • 6
  • 45
  • 66