學習ExtjsForVs(第一個案例HelloWord)

來源:互聯網
上載者:User

標籤:

第一個案例-Hello Word

1.本次練習以ext-4.0.7為例,首先從網上下載ext包.

 

2.開啟包後將裡面的三個檔案或檔案夾拷貝到項目中.

 resource檔案夾

 bootstrap.js

 ext-all.js

3. 在First-Hello.html中構建如下代碼

 

 1 <!DOCTYPE html> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 5     <title></title> 6     <link href="resources/css/ext-all.css" rel="stylesheet" /> 7     <script src="bootstrap.js"></script> 8     <script src="ext-all.js"></script> 9     <script>10         Ext.onReady(function () {11             Ext.MessageBox.alert("Hello", "hello word", function () {12                 alert("First Demo is very good!");13             });14         })15     </script>16 </head>17 <body>18 19 </body>20 </html>
View Code

 

4.在First-Hello.html中右鍵-在瀏覽器中查看

 

alert(0)彈出的是一個真正的視窗, Ext.MessageBox.alert()彈出來到只不過是一個div類比的視窗.

5.點擊OK按鈕後彈框.

 

6.如此,第一個例子就做好了,是不是很簡單.下面解釋下Ext.MessageBox.alert()方法, 它有四個參數,為簡單起見,主要介紹前面三個參數:
      alert( title , msg , function(){} )
      其中title,msg為必選參數,function為選擇性參數,在關閉快顯視窗後觸發。

 Ext.MessageBox.alert("title","msg");

 

 Ext.MessageBox.alert("title","msg",function(){alert("關閉對話方塊後彈出!")});

學習ExtjsForVs(第一個案例HelloWord)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.