Quiero manejar el desbordamiento de los elementos del encabezado del panel. Cuando la cantidad de botones excede el ancho de la pantalla, el ícono de colapso y los botones no están visibles. Quiero hacer que el encabezado se pueda desplazar o mostrar los elementos de desbordamiento en un menú desplegable.
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' }] } }); }); } });Puede obtener el resultado deseado utilizando Ext.toolbar.Toolbar , tiene una configuración overflowHandler que puede establecer en el menu . Prueba esto:
Ext.application({ name: 'Fiddle', launch: function () { Ext.onReady(function () { Ext.create('Ext.toolbar.Toolbar', { width: 200, renderTo: Ext.getBody(), overflowHandler: 'menu', items: [{ xtype: 'component', html: 'title' },{ xtype: 'button', text: 'test1' }, { xtype: 'button', text: 'test2' }, { xtype: 'button', text: 'test3' }, { xtype: 'button', text: 'test4' }, { xtype: 'button', text: 'test5' }] }); }); } });