reorderable.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Ext.Loader.setConfig({enabled: true});
  2. Ext.Loader.setPath('Ext.ux', '../ux/');
  3. Ext.require([
  4. 'Ext.panel.*',
  5. 'Ext.fx.*',
  6. 'Ext.toolbar.*',
  7. 'Ext.button.*',
  8. 'Ext.ux.BoxReorderer'
  9. ]);
  10. Ext.onReady(function() {
  11. var toolbar = Ext.widget('toolbar', {
  12. defaults: {
  13. reorderable: true
  14. },
  15. plugins : Ext.create('Ext.ux.BoxReorderer', {}),
  16. items : [
  17. {
  18. xtype:'splitbutton',
  19. text: 'Menu Button',
  20. iconCls: 'add16',
  21. menu: [{text: 'Menu Item 1'}],
  22. reorderable: false
  23. },
  24. {
  25. xtype:'splitbutton',
  26. text: 'Cut',
  27. iconCls: 'add16',
  28. menu: [{text: 'Cut Menu Item'}]
  29. },
  30. {
  31. text: 'Copy',
  32. iconCls: 'add16'
  33. },
  34. {
  35. text: 'Paste',
  36. iconCls: 'add16',
  37. menu: [{text: 'Paste Menu Item'}]
  38. },
  39. {
  40. text: 'Format',
  41. iconCls: 'add16'
  42. }
  43. ]
  44. });
  45. Ext.widget('panel', {
  46. renderTo: Ext.getBody(),
  47. tbar : toolbar,
  48. border : true,
  49. width : 600,
  50. height : 400
  51. });
  52. });