ExtJS Getting Started

公司的IM用的ExtJS,我本身寫的用的jQuery,因此又得學習了,固然,類似之處確定是有的,好比Ext.onReady()和$(document).ready()感受就是差很少的東西,還有都得熟悉一下選擇器...仍是先入門一下吧... css

http://www.sencha.com/products/extjs/ html

吐槽一下...爲何官網打開速度這麼慢@@! apache

Getting Started

要點: 跨域

1. 最好使用Web服務器來解決XHR的跨域問題,正好機子上配了XAMPP,能夠直接用 服務器

2. 將下載的SDK解壓(假設命名爲extjs),放入XAMPP安裝目錄的htdocs文件夾內,例如:D:\xampp\htdocs\extjs app

目錄中內容(ext-4.1.1a-gpl): ide

啓動服務器,訪問 http://localhost/extjs/index.html 就能夠打開歡迎頁了 學習

這時就能夠直接看本地的文檔,不用抱怨吭爹的網速了...(很關鍵,在本地查看文檔速度很快) ui

3. 應用程序結構 spa

官方推薦的Ext JS應用程序目錄結構:

- appname
    - app
        - namespace
            - Class1.js
            - Class2.js
            - ...
    - extjs —— 下載的SDK文件
    - resources
        - css
        - images
        - ...
    - app.js
    - index.html

建立第一個Demo,仍是在"D:\xampp\htdocs\"目錄下建立文件夾helloext,放入SDK(extjs文件夾),其它文件根據官方教程建立便可,運行結果以下:

動態裝載部分Chrome給出的提示和它說的不大同樣:

添加Ext.require()後就沒有這個提示了

4. 關於引用哪一個庫

  1. ext-debug.js - This file is only for use during development. It provides the minimum number of core Ext JS classes needed to get up and running. Any additional classes should be dynamically loaded as separate files as demonstrated above.

  2. ext.js - same as ext-debug.js but minified for use in production. Meant to be used in combination with your application's app-all.js file. (see section 3)

  3. ext-all-debug.js - This file contains the entire Ext JS library. This can be helpful for shortening your initial learning curve, however ext-debug.js is preferred in most cases for actual application development.

  4. ext-all.js - This is a minified version of ext-all-debug.js that can be used in production environments, however, it is not recommended since most applications will not make use of all the classes that it contains. Instead it is recommended that you create a custom build for your production environment as described in section 3.

5. 最後一部分部署的暫時不想了解...

6. 正如學習jQuery從$(doucument).ready(function () { });開始,ExtJS由Ext.onReady(function () { });開始

接下去就是須要啥查啥了...

幾個月的成果被否認了- -|||||Nevermind...繼續學習

相關文章
相關標籤/搜索