toolbar-menu-overflow.js 624 B

12345678910111213141516171819202122232425262728293031
  1. Ext.require(['*']);
  2. function doTest () {
  3. var buttons = [{
  4. xtype: 'tbtext',
  5. text : 'Text'
  6. }, {
  7. xtype: 'tbseparator'
  8. }];
  9. for (var i = 0; i++ < 20; ) {
  10. buttons.push({
  11. text: 'Button ' + i,
  12. id: 'button' + i,
  13. handler: function(b) {
  14. Ext.Msg.alert('Click', 'You clicked ' + b.text);
  15. }
  16. })
  17. }
  18. Ext.create('Ext.toolbar.Toolbar', {
  19. renderTo: Ext.getBody(),
  20. width : 600,
  21. layout: {
  22. overflowHandler: 'Menu'
  23. },
  24. items: buttons
  25. });
  26. }
  27. Ext.onReady(doTest);