TabWindow.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*!
  2. * Ext JS Library 4.0
  3. * Copyright(c) 2006-2011 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. Ext.define('MyDesktop.TabWindow', {
  8. extend: 'Ext.ux.desktop.Module',
  9. requires: [
  10. 'Ext.tab.Panel'
  11. ],
  12. id:'tab-win',
  13. init : function(){
  14. this.launcher = {
  15. text: 'Tab Window',
  16. iconCls:'tabs'
  17. }
  18. },
  19. createWindow : function(){
  20. var desktop = this.app.getDesktop();
  21. var win = desktop.getWindow('tab-win');
  22. if(!win){
  23. win = desktop.createWindow({
  24. id: 'tab-win',
  25. title:'Tab Window',
  26. width:740,
  27. height:480,
  28. iconCls: 'tabs',
  29. animCollapse:false,
  30. border:false,
  31. constrainHeader:true,
  32. layout: 'fit',
  33. items: [
  34. {
  35. xtype: 'tabpanel',
  36. activeTab:0,
  37. bodyStyle: 'padding: 5px;',
  38. items: [{
  39. title: 'Tab Text 1',
  40. header:false,
  41. html : '<p>Something useful would be in here.</p>',
  42. border:false
  43. },{
  44. title: 'Tab Text 2',
  45. header:false,
  46. html : '<p>Something useful would be in here.</p>',
  47. border:false
  48. },{
  49. title: 'Tab Text 3',
  50. header:false,
  51. html : '<p>Something useful would be in here.</p>',
  52. border:false
  53. },{
  54. title: 'Tab Text 4',
  55. header:false,
  56. html : '<p>Something useful would be in here.</p>',
  57. border:false
  58. }]
  59. }
  60. ]
  61. });
  62. }
  63. return win;
  64. }
  65. });