/ext-4.1.0_b3/docs/extjs/examples/window/layout.js

https://bitbucket.org/srogerf/javascript · JavaScript · 60 lines · 58 code · 2 blank · 0 comment · 3 complexity · 0ec9b28eee477e0df509d4d9a06859e3 MD5 · raw file

  1. Ext.require([
  2. 'Ext.tab.*',
  3. 'Ext.window.*',
  4. 'Ext.tip.*',
  5. 'Ext.layout.container.Border'
  6. ]);
  7. Ext.onReady(function(){
  8. var win,
  9. button = Ext.get('show-btn');
  10. button.on('click', function(){
  11. if (!win) {
  12. win = Ext.create('widget.window', {
  13. title: 'Layout Window',
  14. closable: true,
  15. closeAction: 'hide',
  16. width: 600,
  17. minWidth: 350,
  18. height: 350,
  19. layout: {
  20. type: 'border',
  21. padding: 5
  22. },
  23. items: [{
  24. region: 'west',
  25. title: 'Navigation',
  26. width: 200,
  27. split: true,
  28. collapsible: true,
  29. floatable: false
  30. }, {
  31. region: 'center',
  32. xtype: 'tabpanel',
  33. items: [{
  34. title: 'Bogus Tab',
  35. html: 'Hello world 1'
  36. }, {
  37. title: 'Another Tab',
  38. html: 'Hello world 2'
  39. }, {
  40. title: 'Closable Tab',
  41. html: 'Hello world 3',
  42. closable: true
  43. }]
  44. }]
  45. });
  46. }
  47. button.dom.disabled = true;
  48. if (win.isVisible()) {
  49. win.hide(this, function() {
  50. button.dom.disabled = false;
  51. });
  52. } else {
  53. win.show(this, function() {
  54. button.dom.disabled = false;
  55. });
  56. }
  57. });
  58. });