williamraym

          和我一起學ExtJS——入門

          先從官方下載Extjs 2.0http://www.extjs.com/

          在頁面上導入所需的JS和CSS資源文件

          <html>
          <head>
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

          <link rel="stylesheet" type="text/css" href="plugins/extjs/ext-2.0/resources/css/ext-all.css" />
          <style type="text/css">
              @import url("plugins/extjs/ext-2.0/resources/css/ext-all.css");
          </style>
          <script type="text/javascript" src="plugins/extjs/ext-2.0/adapter/ext/ext-base.js"></script>
          <script type="text/javascript" src="plugins/extjs/ext-2.0/ext-all.js"></script>
          </head>
          <body>
          <div id="id1" style="border:1px solid red;height:200px;width:200px;">id1的范圍,請用mouse 左鍵點擊</div>
          <div id="id2" style="border:1px solid red;height:200px;width:200px;">id2的范圍,請用mouse 左鍵點擊</div>

          來一個實例,最常見的ID元素操作
          傳統(tǒng)的操作:
          <script type="text/javascript">
              
          var d=document.getElementById("id1");
              d.onclick
          =function(){
                  alert(
          "你點擊了id1");
              }

          Extjs里的實現(xiàn):

              var t=Ext.get('id2');
              t.center();
              t.on('click',
          function(){
                  alert(
          "dfsdfsd");
                  t.highlight();
              }
          ,this,
              
          {single: false,
              delay: 
          100}

              );
          });
          </script>
          </body>
          </html>

          如果使用easyjweb就可以直接用以下代碼了

          <html>
          <head>
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
          $html.extjs2()
          <title>跟我一起學Extjs——入門</title>
          </head>
          <body>
          <div id="id1" style="border:1px solid red;height:200px;width:200px;">id1的范圍,請用mouse 左鍵點

          </div>
          <div id="id2" style="border:1px solid red;height:200px;width:200px;">id2的范圍,請用mouse 左鍵點

          </div>
          <script type="text/javascript">
          Ext.onReady(
          function(){
              
          var t=Ext.get('id2');
              t.center();
              t.on('click',
          function(){
                  alert(
          "dfsdfsd");
                  t.highlight();
              }
          ,this,
              
          {single: false,
              delay: 
          100}

              );
          }
          );
          </script>
          <script type="text/javascript">
              
          var d=document.getElementById("id1");
              d.onclick
          =function(){
                  alert(
          "你點擊了id1");
              }

          </script>
          </body>
          </html>

          posted on 2008-01-08 16:22 WilliamRaym 閱讀(1290) 評論(6)  編輯  收藏

          評論

          # re: 和我一起學ExtJS——入門 2008-01-08 17:02 wellfuls

          不錯,真是一個很好的學習開端,謝謝!  回復  更多評論   

          # re: 和我一起學ExtJS——入門 2008-01-08 17:03 wellfuls

          收獲不小,真希望有后續(xù)文章  回復  更多評論   

          # re: 和我一起學ExtJS——入門 2008-01-08 17:05 久城

          up!~最近我也在學哈哈, 多多指教!~  回復  更多評論   

          # re: 和我一起學ExtJS——入門 2008-01-08 18:31 WilliamRaym

          一起進步,哈哈
            回復  更多評論   

          # re: 和我一起學ExtJS——入門 2008-01-08 22:03 xidudui

          很有用,多謝誒  回復  更多評論   

          # re: 和我一起學ExtJS——入門 2008-01-09 09:19 WLR

          更多,請敬請期待  回復  更多評論   


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          <2008年1月>
          303112345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導航

          統(tǒng)計

          常用鏈接

          留言簿(6)

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 磐石市| 阳山县| 来安县| 海南省| 凌源市| 枝江市| 峨山| 红桥区| 曲周县| 中阳县| 房山区| 福海县| 旺苍县| 平舆县| 敖汉旗| 高州市| 新泰市| 顺昌县| 洛隆县| 伊金霍洛旗| 绥滨县| 德江县| 汾西县| 岳阳县| 原平市| 连州市| 类乌齐县| 东港市| 通山县| 修文县| 江城| 巴林左旗| 建平县| 永泰县| 休宁县| 漳浦县| 分宜县| 宝清县| 连南| 惠州市| 调兵山市|