zoukankan      html  css  js  c++  java
  • Extjs 添加事件

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

    Ext.get('MarketsFnote').addListener('change',doFormFieldChange, null, {buffer : 1000})

    Ext.getCmp('MarketsFnote').addListener('change',doFormFieldChange, null, {buffer : 1000})

        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属性:

    listeners: {
       'load': {
          fn: function () {
             this.set('invoicesTotal', invoicesStore.count());
    }, scope: this } }
      listeners : {'click' : function(){alert('点击事件')}} 


            
        e、使用handler属性(此属性不一定是所有控件都有):
            handler : function(){/*事件处理*/}

     

  • 相关阅读:
    1094. Car Pooling
    121. Best Time to Buy and Sell Stock
    58. Length of Last Word
    510. Inorder Successor in BST II
    198. House Robber
    57. Insert Interval
    15. 3Sum java solutions
    79. Word Search java solutions
    80. Remove Duplicates from Sorted Array II java solutions
    34. Search for a Range java solutions
  • 原文地址:https://www.cnblogs.com/xsSystem/p/3102523.html
Copyright © 2011-2022 走看看