You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.2 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. This file is part of Ext JS 3.4
  3. Copyright (c) 2011-2013 Sencha Inc
  4. Contact: http://www.sencha.com/contact
  5. GNU General Public License Usage
  6. This file may be used under the terms of the GNU General Public License version 3.0 as
  7. published by the Free Software Foundation and appearing in the file LICENSE included in the
  8. packaging of this file.
  9. Please review the following information to ensure the GNU General Public License version 3.0
  10. requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  11. If you are unsure which license is appropriate for your use, please contact the sales department
  12. at http://www.sencha.com/contact.
  13. Build date: 2013-04-03 15:07:25
  14. */
  15. Ext.onReady(function(){
  16. // NOTE: This is an example showing simple state management. During development,
  17. // it is generally best to disable state management as dynamically-generated ids
  18. // can change across page loads, leading to unpredictable results. The developer
  19. // should ensure that stable state ids are set for stateful components in real apps.
  20. Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
  21. // create some portlet tools using built in Ext tool ids
  22. var tools = [{
  23. id:'gear',
  24. handler: function(){
  25. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  26. }
  27. },{
  28. id:'close',
  29. handler: function(e, target, panel){
  30. panel.ownerCt.remove(panel, true);
  31. }
  32. }];
  33. var viewport = new Ext.Viewport({
  34. layout:'border',
  35. items:[{
  36. region:'west',
  37. id:'west-panel',
  38. title:'West',
  39. split:true,
  40. width: 200,
  41. minSize: 175,
  42. maxSize: 400,
  43. collapsible: true,
  44. margins:'35 0 5 5',
  45. cmargins:'35 5 5 5',
  46. layout:'accordion',
  47. layoutConfig:{
  48. animate:true
  49. },
  50. items: [{
  51. html: Ext.example.shortBogusMarkup,
  52. title:'Navigation',
  53. autoScroll:true,
  54. border:false,
  55. iconCls:'nav'
  56. },{
  57. title:'Settings',
  58. html: Ext.example.shortBogusMarkup,
  59. border:false,
  60. autoScroll:true,
  61. iconCls:'settings'
  62. }]
  63. },{
  64. xtype:'portal',
  65. region:'center',
  66. margins:'35 5 5 0',
  67. items:[{
  68. columnWidth:.33,
  69. style:'padding:10px 0 10px 10px',
  70. items:[{
  71. title: 'Grid in a Portlet',
  72. layout:'fit',
  73. tools: tools,
  74. items: new SampleGrid([0, 2, 3])
  75. },{
  76. title: 'Another Panel 1',
  77. tools: tools,
  78. html: Ext.example.shortBogusMarkup
  79. }]
  80. },{
  81. columnWidth:.33,
  82. style:'padding:10px 0 10px 10px',
  83. items:[{
  84. title: 'Panel 2',
  85. tools: tools,
  86. html: Ext.example.shortBogusMarkup
  87. },{
  88. title: 'Another Panel 2',
  89. tools: tools,
  90. html: Ext.example.shortBogusMarkup
  91. }]
  92. },{
  93. columnWidth:.33,
  94. style:'padding:10px',
  95. items:[{
  96. title: 'Panel 3',
  97. tools: tools,
  98. html: Ext.example.shortBogusMarkup
  99. },{
  100. title: 'Another Panel 3',
  101. tools: tools,
  102. html: Ext.example.shortBogusMarkup
  103. }]
  104. }]
  105. /*
  106. * Uncomment this block to test handling of the drop event. You could use this
  107. * to save portlet position state for example. The event arg e is the custom
  108. * event defined in Ext.ux.Portal.DropZone.
  109. */
  110. // ,listeners: {
  111. // 'drop': function(e){
  112. // Ext.Msg.alert('Portlet Dropped', e.panel.title + '<br />Column: ' +
  113. // e.columnIndex + '<br />Position: ' + e.position);
  114. // }
  115. // }
  116. }]
  117. });
  118. });