風人園

          弱水三千,只取一瓢,便能解渴;佛法無邊,奉行一法,便能得益。
          隨筆 - 99, 文章 - 181, 評論 - 56, 引用 - 0
          數據加載中……

          Ext應用三 -- Tab


          簡單tab的應用,參考例子
              var tabs = new Ext.TabPanel({
                  renderTo: 'tabs1',
                  width:
          450,
                  activeTab: 
          0,
                  frame:
          true,
                  defaults:
          {autoHeight: true},
                  items:[
                      
          {contentEl:'script', title: 'Short Text'},
                      
          {contentEl:'markup', title: 'Long Text'}
                  ]
              }
          );

          tab的激活事件
          在item的配置中增加
              listeners: {activate: handleActivate}
          handleActivate是一個方法,也就是當激活某一個tab的時候,就會調用這個方法。

              // second tabs built from JS
              var tabs2 = new Ext.TabPanel({
                  renderTo: document.body,
                  activeTab: 
          0,
                  width:
          600,
                  height:
          250,
                  plain:
          true,
                  defaults:
          {autoScroll: true},
                  items:[
          {
                          title: 'Normal Tab',
                          html: 
          "My content was added during construction."
                      }
          ,{
                          title: 'Ajax Tab 
          1',
                          autoLoad:'ajax1.htm'
                      }
          ,{
                          title: 'Ajax Tab 
          2',
                          autoLoad: 
          {url: 'ajax2.htm', params: 'foo=bar&wtf=1'}
                      }
          ,{
                          title: 'Event Tab',
                          listeners: 
          {activate: handleActivate},
                          html: 
          "I am tab 4's content. I also have an event listener attached."
                      }
          ,{
                          title: 'Disabled Tab',
                          disabled:
          true,
                          html: 
          "Can't see me cause I'm disabled"
                      }

                  ]

              }
          );
          autoLoad:異步載入的頁面。

          posted on 2007-12-28 14:53 風人園 閱讀(1084) 評論(0)  編輯  收藏 所屬分類: Ext

          主站蜘蛛池模板: 赤峰市| 南城县| 衡东县| 乌苏市| 德令哈市| 温宿县| 渑池县| 湟中县| 濮阳县| 永年县| 清涧县| 穆棱市| 梁山县| 张家界市| 台湾省| 河西区| 丹东市| 定陶县| 修文县| 平果县| 黄石市| 萍乡市| 滁州市| 准格尔旗| 阿巴嘎旗| 米脂县| 巴中市| 宿州市| 久治县| 潮州市| 龙泉市| 赞皇县| 连州市| 南开区| 浮梁县| 盐池县| 闻喜县| 瑞安市| 习水县| 新闻| 栾城县|