1. 程式人生 > >ExtJS中常用類和函式(自己總結的,不完全)

ExtJS中常用類和函式(自己總結的,不完全)

Ext類
1.  Ext.onReady(Function fn,Object scope,boolean override)
2.  Ext.get(Mixed el)
3.  Ext.select(String/Array selector,[Boolean unique],[HTMLElement/String root])
4.  Ext.query(String path,[Node root])
5. Ext.getCmp(string id)
6.  Ext.getDom(Mixed el)
7.  Ext.isEmpty(Mixed value,[Boolean allowBlank])
8.  Ext.namespace(string namespace1,string namespace2,string etc)
9.  Ext.each(Array/NodeList/Mixed array,Function fn,object scope)
10.     Ext.apply(Object obj,Object config,Object defaults)

Ext.DomHelper
11.     Ext.DomHelper.append(Mixed el,Object/String o,[Boolean returnElement])
12.     Ext.DomHelper.applyStyles(string/HTMLElement el,String/Object/Function styles)
13.     Ext.DomHelper.createTemplate(Object o)
14.     Ext.DomHelper.insertAfter(Mixed el,Object o,[Boolean returnElement])
15.     Ext.DomHelper.insertBefore(Mixed el,Object/string o,[Boolean returnElement])
16.     Ext.DomHelper.insertFirst(Mixed el,Object/string o,[Boolean returnElement])
17.     Ext.DomHelper.insertHtml(string where, HTMLElement el,string html)
18.     Ext.DomHelper.overwrite(Mixed el,object/string o,[Boolean returnElement])

Ext.DomQuery
19.     Ext.DomQuery.compile(string selector,[string type])
20.     Ext.DomQuery.filter(Array el,string selector,Boolean nonMatches)
21.     Ext.DomQuery.is(string/HTMLElement/Array el,string selector)
22.     Ext.DomQuery.select(string selector,[Node root])
23.     Ext.DomQuery.selectNode(string selector,[Node root])

Ext.util.CSS
24.     Ext.util.CSS.createStyleSheet(string cssText,string id)
25.     Ext.util.CSS.getRule(string/Array selector,Boolean refreshCache)
26.     Ext.util.CSS.swapStyleSheet(string id,string url)
27.     Ext.util.CSS.removeStyleSheet(string id)

Ext.util.ClickRepeater
只有三個事件 click()  mousedown()   nouseup()


Ext.util.DelayedTask
canelc()   delay()


Ext.util.Format提供常用的格式化方法
28      Ext.util.Format.ellipsis(string value,Number length) //將指定字串超長部分用省略號代替並返回
29      Ext.util.Format.capitalize(string value)             //將指定字串轉換成小寫並返回
30      Ext.util.Format.date(Mixed value,[string format])    //將日期文字按指定的格式進行轉換
31      Ext.util.Format.htmlEncode(string value)             //將引數Value進行html字元的替換並返回
32      Ext.util.Format.htmlDecode(string value)             //htmlEncode的逆過程
33      Ext.util.Format.stripTags(Mixed value)               //將字串中的html標籤進行替換並返回替換後的字串
34      Ext.util.Format.substr(string value,Number start,Number length) //擷取value從start到length間的字元並返回


Ext.util.JSON編碼和解碼物件
35.     Ext.util.JSON.decode(string json)
36. Ext.util.JSON.encode(Mixed o)
 

Ext.util.MixedCollection
37.     Ext.util.MixedCollection.add(string key,object o)        //將物件加入到集合
38.     Ext.util.MixedCollection.addAll(object/Array objs):void  //將陣列中的物件加入到集合中
39.     Ext.util.MixedCollection.clear():void                    //從集合中移除所有物件
40.     Ext.util.MixedCollection.clone()                         //克隆集合
41.     Ext.util.MixedCollection.contains(object o):Boolean      //匹配集合中的關聯物件(是否包含物件)
        Ext.util.MixedCollection.containsKey(string key):Boolean //匹配集合中的關聯物件(是否包含該key)
42.     Ext.util.MixedCollection.each(Function fn,[object scope]):void  //迭代集合中的物件,呼叫指定的方法
43.     Ext.util.MixedCollection.first():object                         //獲取集合中的第一個物件
        Ext.util.MixedCollection.get(string/Number key):object          //獲取集合總與指定的key關聯的物件
44. Ext.util.MixedCollection.getCount():Number                      //取得陣列數量
45. Ext.util.MixedCollection.getKey(object item):object             //取得指定物件的索引
46.     Ext.util.MixedCollection.indexof(object o):Number               //取得指定物件在集合中的位置下標
47. Ext.util.MixedCollection.indexofkey(string key):Number          //根據索引取得物件在集合中的下標
48. Ext.util.MixedCollection.item(string/Number key):object         //根據在集合中的指定索引或下標取得物件
49.     Ext.util.MixedCollection.itemAt(Number index):object            //根據在集合中的指定下標取得物件
50. Ext.util.MixedCollection.key(string/Number key):object          //根據在集合中的關聯時的索引取得物件
51. Ext.util.MixedCollection.remove(object o):object  //移除集合中的關聯物件
52. Ext.util.MixedCollection.removeAt(Number index):object  //根據下標移除集中的關聯物件
53. Ext.util.MixedCollection.removeKey(string key):object  //根據索引移除集合中關聯物件
54. Ext.util.MixedCollection.replace(string key,[o {object}]):object//替換物件


類中重要的事件
55. add(Nimber index,object o,string key)         //當向一個集合中新增一個物件結束併成功後觸發此事件
56. clear                                         //移除所有物件時觸發此事件
57. remove(object o,[string key])             //移除指定的物件時的事件
58.     replace(string key,object old,object new)     //替換物件時的事件


Ext.util.TaskRunner
59. Ext.util.TaskRunner([Number interval])       //新建立一個定時任務
60.     Ext.util.TaskRunner.start([object task]):object                   //啟動一個執行緒
61. Ext.util.TaskRunner.stop(object task):object        //停止指定的任務執行緒
62.     Ext.util.TaskRunner.stopAll():void          /停止所有執行緒的執行


Ext.util.TextMetrics       //得到塊狀化文字規格
63.     Ext.util.TextMetrics.bind(string/HTMLElement el):void         //將文字塊繫結到el元素,同時將el的原有樣式應用到文字
64.     Ext.util.TextMetrics.createInstance(string/HTMLElement el,[Number fixedWidth]):Ext.util.TextMetrics.Instance
65.     Ext.util.TextMetrics.getHeight(string text):Number            //獲取文字的高度
66.     Ext.util.TextMetrics.getSize(strnig text):object              //獲取文字的高、寬
67.     Ext.util.TextMetrics.getWidth(string text):Number       //獲取文字的寬度
68. Ext.util.TextMetrics.measure(string/HTMLElement el,string text,[Number fixedWidth]):object //獲取指定節點內文字塊的寬、高
69. Ext.util.TextMetrics.setFixedWidth(Number width):void         //指定文字塊的寬


Ext.KeyNav為元素提供簡單的按鍵處理方法
70.     KeyNav(Mixed el,object config)                                //例項化一個鍵盤繫結物件
71.     Ext.KeyNav.disable():void                                     //廢棄原有的鍵盤繫結
72. Ext.KeyNav.enable():void          //使廢棄的鍵盤繫結重新生效


Ext.KeyMap提供更靈活強大的按鍵處理方法
73.     KeyMap(Mixed el,object config,[string eventName])
74.     addBinding(object/Array config):void                          //給物件新增鍵盤繫結
75.     Ext.KeyMap.disable():void                                     //廢棄已繫結到KeyMap的配置
76.     Ext.KeyMap.enable():void                                      //使KeyMap廢棄的配置重新生效
77.     Ext.KeyMap.isEnabled():Boolean                                //如果KeyMap配置是有效的,而返回true,否則返回false