EXT 表單設計器(guibuilder)簡單使用教程

來源:互聯網
上載者:User

說明: 本教程在我推薦的ajax/ext目錄規範環境下開發,如環境不同,請自行修改相關路徑

本項目架構及代碼在此下載

1.開啟項目

2.在根目錄下建立demo.html:

 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>ExtJs Gui Designer Demo</title>
<!-- The ExtJs base 2.02 -->
<link rel="stylesheet" type="text/css" href="framework/ext-2.0.2/resources/css/ext-all.css" temp_href="framework/ext-2.0.2/resources/css/ext-all.css"/>
<script type="text/javascript" src="framework/ext-2.0.2/adapter/ext/ext-base.js" temp_src="framework/ext-2.0.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="framework/ext-2.0.2/ext-all.js" temp_src="framework/ext-2.0.2/ext-all.js"></script>

<!-- The Json Panel -->
<script type="text/javascript" src="widget/Ext.ux.JsonPanel.js" temp_src="widget/Ext.ux.JsonPanel.js"></script>
</head>

<body>
<script>
new Ext.Viewport({
items : new Ext.ux.JsonPanel({autoLoad:'modules/user.json'}),
layout: 'fit'
}).show();
</script>
</body>
</html>

 

注意 其中user.json就是GUIBUILDER中產生的程式碼.

3.開啟GuiBuilder

 

4.設計介面

1).首先雙擊 FormPanel,或把FormPanel拖進主面板

2)接著拖動TextField進入FormPanle,並修改FieldLabel為"使用者名稱",添加"id"屬性為"username"

3)再插入一個按鈕button,添加handle事件

4)點擊click here to edit,彈出指令碼編輯框,在其實輸入:


function(){


alert(Ext.get("username").getValue());


}

輸入,點擊apply

5) 點擊 copy json,或開啟edit json,拷貝其中的代碼,將其另存新檔user.json

6) 開啟demo.html

聯繫我們

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