Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / toolbar / toolbar-menu-overflow.js
diff --git a/examples/toolbar/toolbar-menu-overflow.js b/examples/toolbar/toolbar-menu-overflow.js
new file mode 100644 (file)
index 0000000..c78eb19
--- /dev/null
@@ -0,0 +1,26 @@
+Ext.require(['*']);
+var buttons = [{
+    xtype: 'tbtext',
+    text : 'Text'
+},  {
+    xtype: 'tbseparator'
+}];
+for (var i = 0; i < 20; i++) {
+    buttons.push({
+        text: 'Button ' + (i + 1),
+        handler: function(b) {
+            Ext.Msg.alert('Click', 'You clicked ' + b.text);
+        }
+    })
+}
+
+Ext.onReady(function() {
+    Ext.create('Ext.toolbar.Toolbar', {
+        renderTo: Ext.getBody(),
+        width : 600,
+        layout: {
+            overflowHandler: 'Menu'
+        },
+        items: buttons
+    });
+});
\ No newline at end of file