一、ExtJs是什么?
ExtJS是一個用來開發瀏覽器富客戶端(RIA,Rich Internet Application)的Ajax框架,通過參考JavaSwing等機制組織可視化組件,完全獨立於后端語言,使不同后端語言開發人員在沒有較多前端知識儲備情況下仍然可以開發出優美的界面(不用過多理會html+css+美工),比較適合企業管理系統之類的應用。Extjs4以后引入mvc編程思想,更加豐富了該框架,extjs學習曲線較為陡峭。萬事開頭難,學好extjs對獨立開發可用的單功能應用系統有幫助,可以減少對前端開發人員的依賴。
二、參照官方文檔開始搭建簡單應用。
- 打開官網鏈接,http://docs.sencha.com/extjs/6.2.0/index.html,Guides ->Getting Started ->Setup.
- 官方實例使用sencha cmd工具來管理extjs應用,依葫蘆畫瓢,跟着做一遍。
- 第一步:下載安裝sencha cmd,點擊 Download and Install Sencha Cmd 6 下載,setup,一直點下一步到安裝完成。安裝完成后sencha命令會自動添加到windows用戶環境變量中。
- 第二步:下載Extjs6.2 SDk,extjs為雙執照,下載ext-6.2.0-gpl, http://pan.baidu.com/s/1hssLw5e 解壓到目錄。
- 使用sencha命令創建應用,部署到sencha自帶的jetty服務器。(jetty是一個開源的servlet容器)
比如:在E:\test\ext6.2目錄下創建名為TestApp的應用,命令為:(命令結構:sencha -sdk 第二步下載的sdk解壓的目錄 generate app 應用名稱 應用存放路徑)
cd E:\test\ext6.2
E:sencha -sdk F:\opensource\javascript\ext-6.2.0-gpl\ext-6.2.0 generate app TestApp ./TestApp
cd TestApp
sencha app watch
- 在瀏覽器中輸入http://localhost:1841查看創建的創建的應用
- 回過頭看TestApp的目錄,一個簡單的mvc結構的extjs應用就產生了。
As mentioned above, Universal applications are made up of three important areas:(通用的應用主要包括三個重要組成部分)
-
- Shared app area (most suitable for stores, models, and controllers). This area can be found in the
appfolder in your application's root.(共享部分,主要包括倉庫、模型、控制器,在應用根目錄的app文件夾中) - Classic app area (views and logic specific to the classic aspect of your application). This area can be found in the
classic/srcfolder in your application's root.(經典風格的視圖和邏輯性) - Modern app area (views and logic specific to the modern aspect of your application). This area can be found in the
modern/srcfolder in your application's root(現代風格的視圖和邏輯性)
- Shared app area (most suitable for stores, models, and controllers). This area can be found in the
