Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / examples / toolbar / reorderable.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 Ext.Loader.setConfig({enabled: true});
16
17 Ext.Loader.setPath('Ext.ux', '../ux/');
18
19 Ext.require([
20     'Ext.panel.*',
21     'Ext.fx.*',
22     'Ext.toolbar.*',
23     'Ext.button.*',
24     'Ext.ux.BoxReorderer'
25 ]);
26
27 Ext.onReady(function() {
28     var toolbar = Ext.createWidget('toolbar', {
29         renderTo: Ext.getBody(),
30         defaults: {
31             reorderable: true
32         },
33         plugins : Ext.create('Ext.ux.BoxReorderer', {}),
34         items   : [
35             {
36                 xtype:'splitbutton',
37                 text: 'Menu Button',
38                 iconCls: 'add16',
39                 menu: [{text: 'Menu Item 1'}],
40                 reorderable: false
41             },
42             {
43                 xtype:'splitbutton',
44                 text: 'Cut',
45                 iconCls: 'add16',
46                 menu: [{text: 'Cut Menu Item'}]
47             },
48             {
49                 text: 'Copy',
50                 iconCls: 'add16'
51             },
52             {
53                 text: 'Paste',
54                 iconCls: 'add16',
55                 menu: [{text: 'Paste Menu Item'}]
56             },
57             {
58                 text: 'Format',
59                 iconCls: 'add16'
60             }
61         ]
62     });
63     
64     Ext.createWidget('panel', {
65         renderTo: Ext.getBody(),
66         tbar    : toolbar,
67         border  : true,
68         width   : 600,
69         height  : 400
70     });
71 });