非常有用的Ext.core.Element

來源:互聯網
上載者:User

Ext.core.Element是所有組件及控制項操作的基礎,是一個DOM對象的封裝,加入了DOM的操作處理,並根據不同的瀏覽器進行處理。該類的所有執行個體都向我們展示通過DOM繼續Ext.fx.Anim的視覺效果。該類的事件並非Ext的底層事件,而是封裝的瀏覽器事件,也可以通過Ext.EventObject.browserEvent訪問到更多的底層瀏覽器事件。通過ID或DOM節點來得到Ext.core.Element對象,如:Ext.get(元素id或DOM元素節點)。

Element的控制及使用方法樣本:

Ext.onReady(function() {    var e1 = Ext.get("the-id");    var appendE1 = Ext.get("the-id-append");    function fn1() {        Ext.Msg.alert('提示', "您在id為'the-id'的Element上按下了ctrl+c鍵");    }    e1.addCls("special-css");    appendE1.addCls('special-css');    appendE1.setWidth(240);    appendE1.setWidth(240, true);    e1.focus();    e1.addClsOnFocus("focus-css");    e1.addClsOnOver("mouseover-css");    e1.addClsOnClick("click-css");    e1.setWidth(240);    e1.setWidth(240, true);    e1.addKeyMap({key:"c",ctrl:true,fn:fn1,scope:e1});    e1.addKeyListener({key:'g',ctrl:true},fn1,e1);});function callAppend() {    Ext.Msg.alert('提示', Ext.get("the-id-append"),getComputedWidth());    Ext.get("the-id").appendTo(Ext.get("the-id-append"));}

 

聯繫我們

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