Ext.tab.Panel:标签面板就像一个普通的面板,但支持卡标签面板布局。

<!DOCTYPE html>
<html>
   <head>
      <link href="./ext-6.0.0-gpl/ext-6.0.0/build/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet">
      <script src="./ext-6.0.0-gpl/ext-6.0.0/build/ext-all.js"></script>
      <script type="text/javascript">
         Ext.onReady(function () {
          Ext.create('Ext.tab.Panel', {
            renderTo: Ext.getBody(),
            height: 300,
            width: 200,
            items: [{
              xtype: 'panel',
              title: 'Tab one',
              html: 'The first tab',
              listeners: {
                render: function() {
                  Ext.MessageBox.alert('Tab one', 'Tab One was clicked.');
                }
              }
            },{
              title: 'Tab two',
              html: 'The second tab',
              listeners: {
                render: function() {
                  Ext.MessageBox.alert('Tab two', 'Tab Two was clicked.');
                }
              }
            }]
          })
       });
      </script>
   </head>
   <body>
   </body>
</html>

运行结果:
image.png


零号
1 声望0 粉丝