grouptabs.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. Ext.onReady(function () {
  2. Ext.tip.QuickTipManager.init();
  3. // create some portlet tools using built in Ext tool ids
  4. var tools = [{
  5. type: 'gear',
  6. handler: function () {
  7. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  8. }
  9. }, {
  10. type: 'close',
  11. handler: function (e, target, panel) {
  12. panel.ownerCt.remove(panel, true);
  13. }
  14. }];
  15. Ext.create('Ext.Viewport', {
  16. layout: 'fit',
  17. items: [{
  18. xtype: 'grouptabpanel',
  19. activeGroup: 0,
  20. items: [{
  21. mainItem: 1,
  22. items: [{
  23. title: 'Tickets',
  24. iconCls: 'x-icon-tickets',
  25. tabTip: 'Tickets tabtip',
  26. //border: false,
  27. xtype: 'gridportlet',
  28. margin: '10',
  29. height: null
  30. }, {
  31. xtype: 'portalpanel',
  32. title: 'Dashboard',
  33. tabTip: 'Dashboard tabtip',
  34. border: false,
  35. items: [{
  36. flex: 1,
  37. items: [{
  38. title: 'Portlet 1',
  39. html: '<div class="portlet-content">' + Ext.example.bogusMarkup + '</div>'
  40. }, {
  41. title: 'Stock Portlet',
  42. items: {
  43. xtype: 'chartportlet'
  44. }
  45. }, {
  46. title: 'Portlet 2',
  47. html: '<div class="portlet-content">' + Ext.example.bogusMarkup + '</div>'
  48. }]
  49. }]
  50. }, {
  51. title: 'Subscriptions',
  52. iconCls: 'x-icon-subscriptions',
  53. tabTip: 'Subscriptions tabtip',
  54. style: 'padding: 10px;',
  55. border: false,
  56. layout: 'fit',
  57. items: [{
  58. xtype: 'tabpanel',
  59. activeTab: 1,
  60. items: [{
  61. title: 'Nested Tabs',
  62. html: Ext.example.shortBogusMarkup
  63. }]
  64. }]
  65. }, {
  66. title: 'Users',
  67. iconCls: 'x-icon-users',
  68. tabTip: 'Users tabtip',
  69. style: 'padding: 10px;',
  70. html: Ext.example.shortBogusMarkup
  71. }]
  72. }, {
  73. expanded: true,
  74. items: [{
  75. title: 'Configuration',
  76. iconCls: 'x-icon-configuration',
  77. tabTip: 'Configuration tabtip',
  78. style: 'padding: 10px;',
  79. html: Ext.example.shortBogusMarkup
  80. }, {
  81. title: 'Email Templates',
  82. iconCls: 'x-icon-templates',
  83. tabTip: 'Templates tabtip',
  84. style: 'padding: 10px;',
  85. border: false,
  86. items: {
  87. xtype: 'form',
  88. // since we are not using the default 'panel' xtype, we must specify it
  89. id: 'form-panel',
  90. labelWidth: 75,
  91. title: 'Form Layout',
  92. bodyStyle: 'padding:15px',
  93. labelPad: 20,
  94. defaults: {
  95. width: 230,
  96. labelSeparator: '',
  97. msgTarget: 'side'
  98. },
  99. defaultType: 'textfield',
  100. items: [{
  101. fieldLabel: 'First Name',
  102. name: 'first',
  103. allowBlank: false
  104. }, {
  105. fieldLabel: 'Last Name',
  106. name: 'last'
  107. }, {
  108. fieldLabel: 'Company',
  109. name: 'company'
  110. }, {
  111. fieldLabel: 'Email',
  112. name: 'email',
  113. vtype: 'email'
  114. }],
  115. buttons: [{
  116. text: 'Save'
  117. }, {
  118. text: 'Cancel'
  119. }]
  120. }
  121. }]
  122. }, {
  123. expanded: false,
  124. items: {
  125. title: 'Single item in third',
  126. bodyPadding: 10,
  127. html: '<h1>The third tab group only has a single entry.<br>This is to test the tab being tagged with both "first" and "last" classes to ensure rounded corners are applied top and bottom</h1>',
  128. border: false
  129. }
  130. }]
  131. }]
  132. });
  133. });