extJS 建立類

來源:互聯網
上載者:User

標籤:des   style   blog   http   io   color   ar   os   sp   

<!DOCTYPE html><html lang="en"><head>    <meta charset="utf-8">    <title>Welcome to Ext JS 5.0</title>    <meta name="description" content="Create amazing web apps built on web standards. Sencha Touch, HTML5 mobile app framework. Ext JS, cross-browser JavaScript framework. Ext GWT" />    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />    <link rel="shortcut icon" type="image/ico" href="/favicon.ico" />     <!-- 下面的檔案都是下載好的extJs包中的 bulid目錄下 -->    <!-- 引入必須的css -->    <link rel="stylesheet" href="build/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css" type="text/css" />          <!-- 引入必須的js -->    <script src="build/ext-all.js" type="text/javascript" charset="utf-8"></script>    <script src="build/packages/ext-theme-crisp/build/ext-theme-crisp.js" type="text/javascript" charset="utf-8"></script>    </head><body>    <script type="text/javascript">        //在頁面載入完成之後執行          //Ext.onReady(function(){          //    Ext.MessageBox.alert(‘hello‘,‘extJs 你好!‘);          //});        /* var win = new Ext.Window(                     {                         width:400,                          height:300,                          title:"hello word",                          buttons:[{text:"確定"},{text:"取消"}],                     }                 );          win.show(); */                  Ext.onReady(function(){                          //定義一個類              Ext.define(‘Person‘,{                  name:‘jaune‘,                  age:18,                  //定義一個方法                  see:function(){ alert(‘我的名字叫‘+this.name); },                  //建構函式                  constructor:function(config){                      //將配置的所有屬性都複製到指定的對象                      Ext.apply(this,config);                  }              });                            Ext.define(‘Man‘,{                  extend:‘Person‘,                  sex:‘Male‘,                  constructor:function(config){                      if(config != null){                        if(config.hasOwnProperty(‘sex‘)){                              delete config.sex;                          }                     }                                                                this.callParent([config]);                  },                  toString:function(){                      return {                          name:this.name,                          age:this.age,                          sex:this.sex                      }                  }              });                            var man = new Man({                name:‘zh‘,                age:12,                sex:‘man‘            });              alert(man.toString().sex);         });    </script></body></html>

 

  

extJS 建立類

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.