I want to handle overflow for panel header items .when the number of buttons exceed the screen width the collapse icon and buttons are not visible. I want to make the header scrollable or show the overflow items in a dropdown menu.
Ext.application({
name : 'Fiddle',
launch : function() {
Ext.onReady(function () {
Ext.create('Ext.panel.Panel', {
width: 200,
height: 50,
collapsible: true,
renderTo: Ext.getBody(),
title: 'title',
layout : 'hbox',
header: {
title: {
text: 'title',
flex: undefined
},
items: [{
xtype: 'button',
text: 'test',
margin: '0 10'
},{
xtype: 'button',
text: 'test',
margin: '0 10'
},{
xtype: 'button',
text: 'test',
margin: '0 10'
},{
xtype: 'button',
text: 'test',
margin: '0 10'
},{
xtype: 'button',
text: 'test',
margin: '0 10'
},{
xtype:'tbfill'
}]
}
});
});
}
});


You can get the desired result using an
Ext.toolbar.Toolbar, it has anoverflowHandlerconfig which you can set tomenu. Try this: