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.

54 lines
1.5 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. var tabs = new Ext.TabPanel({
  17. renderTo:'tabs',
  18. resizeTabs:true, // turn on tab resizing
  19. minTabWidth: 115,
  20. tabWidth:135,
  21. enableTabScroll:true,
  22. width:600,
  23. height:250,
  24. defaults: {autoScroll:true},
  25. plugins: new Ext.ux.TabCloseMenu()
  26. });
  27. // tab generation code
  28. var index = 0;
  29. while(index < 7){
  30. addTab();
  31. }
  32. function addTab(){
  33. tabs.add({
  34. title: 'New Tab ' + (++index),
  35. iconCls: 'tabs',
  36. html: 'Tab Body ' + (index) + '<br/><br/>'
  37. + Ext.example.bogusMarkup,
  38. closable:true
  39. }).show();
  40. }
  41. new Ext.Button({
  42. text: 'Add Tab',
  43. handler: addTab,
  44. iconCls:'new-tab'
  45. }).render(document.body, 'tabs');
  46. });