zoukankan      html  css  js  c++  java
  • Extjs 中的添加事件总结

    a、使用addListeners:
            addListener( String eventName, Function fn, Object scope, Object options ) 
            panel.addListeners('click',function(){alert('点击事件')},this);

        b、使用addEvents自定义事件:
            addEvents(Object o)
            panel.addEvents({"eventName":true})

            激活事件
            fireEvent( String eventName, Object... args ) : Boolean
            panel.fireEvent("eventName",this);

        c、使用on:
            on( String eventName, Function handler, Object scope, Object options ) 
            panel.on('click',function(){alert('点击事件')},this);

        d、使用listeners属性:
            listaners : {'click' : function(){alert('点击事件')}}    
        e、使用handler属性(此属性不一定是所有控件都有):
            handler : function(){/*事件处理*/}

  • 相关阅读:
    CF995A Tesla
    CF961D Pair Of Lines
    P1186 玛丽卡
    CF986B Petr and Permutations
    hdu6331 Problem M. Walking Plan
    Edison UVALive3488
    Be a Smart Raftsman SGU475
    100198H Royal Federation
    100197G Robbers
    Evil Book -- CodeChef
  • 原文地址:https://www.cnblogs.com/lidabo/p/2917880.html
Copyright © 2011-2022 走看看