Ext布局实例-----cardLayout布局

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>cardLayout.html</title>
 
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
   
    <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"/>
 <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="ext/ext-all.js"></script>
   
    <script type="text/javascript">
      Ext.onReady(function(){
     
        var panel=new Ext.Panel({
           layout:'card',
           activeItem:0,
           title:'Ext.layout.CardLayout示例',
           frame:true,
           height:250,
           width:300,
           applyTo:'panel',
           items:[
           {
              title:'嵌套面板一',
              html:'说明一',
              id:'p1'
           },
           {
              title:'嵌套面板二',
              html:'说明2',
              id:'p2'
           },
           {
              title:'嵌套面板三',
              html:'说明三',
              id:'p3'
           },          
           {
              title:'嵌套面板四',
              html:'说明四',
              id:'p4'
           }
          ],
           buttons:[
             {
                text:'上一页',
                handler:changePage
            
             },
             {
               text:'下一页',
               handler:changePage
             }
          
           ]
        });
       
        function changePage(btn){
           var index=Number(panel.layout.activeItem.id.substring(1));
           if(btn.text=='上一页'){
               index-=1;
               if(index<1){
                 index=1;
               }
           }else{
              index+=1;
              if(index>3){
             
                 index=3;
              }
           }
          
           panel.layout.setActiveItem('p'+index);
       
        }
     
     
     
     
      });
    </script>
 

  </head>
 
  <body>
    <div id="panel"></div>
  </body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值