Extjs 學習之記錄

來源:互聯網
上載者:User

視頻地址: http://v.youku.com/v_show/id_XMTA4NzIxNTc2.html

2013-08-23 20:48:11

1、Viewport

Ext.container.Viewport代表瀏覽器視窗的整個地區,將document body作為渲染對象,它會根據瀏覽器視窗的大小自動調整自身的尺寸,在一個頁面中只允許出現一個Viewport執行個體。此外它沒有提供對捲軸的支援,如果需要使用捲軸需要在其子面板中進行設定。

2013-08-23 23:48:17

2、//命名空間

Ext.namespace('Ext.test');

//Person類

Ext.test.Person = function()
{
};

//Person的靜態方法 在頁面使用Ext.test.Person.printt()即可調用
Ext.test.Person.printt=function(){
var temp=new Ext.test.Person();
alert(temp.name);
};

//Ext.apply 是將後面的json對象賦值給Person的相應屬性

Ext.apply(Ext.test.Person.prototype,{

name:"xx",
printt:function(){  //該方法必須執行個體化Person後才可調用:即new Ext.test.Person().printt();
alert(this.name);
}
}); 

中的Ext.test.Person.prototype寫成了Ext.test.Person.propertype
要命啊,找了一晚上!

3、類繼承

2013-08-24 00:09:24

首先要定義一個類(命名空間+類名)假如還是Ext.test下的另一個
Person1

Ext.test.Person1
= function() {
};

然後使用Ext.extend(Ext.test.Person1,Ext.test.Person,{name:"ff"});使Person1繼承Person,且對name重新賦值,

調用new
Ext.test.Person1().printt(); 即可運行


4、命名空間的別名
 2013-08-24 00:33:14

在聲明Ext.namespace('Ext.test');後

使用別名代替,那麼後面用到命名空間的地方就可以用命名空間別名代替:

Dc=Ext.test;//注意沒有引號

規則
首字母必須大寫,後面的字母小寫

類別名規則:全部大寫
如 PS=Dc.Person;或者  PS=Ext.test.Person;
這個必須寫在 定義了Person下面,不然就不起作用即先有類再有別名

5、renderTo
: Ext.getBody();   2013-08-24 10:57:04

eg:
var but=new Ext.Button({

name:"test",

renderTo
: Ext.getBody()

});
  是建立一個名稱為test的按鈕,並將產生的but對象放置到通過Ext.getBody()
獲得的document的body中,因為通過 new Ext.Button獲得的不是html元素,要通過renderTo將其轉換為html元素

listeners



聯繫我們

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