本帖最后由 gp2852 于 2010-12-23 11:48:28 编辑

解决方案 »

  1.   

    this.addListener("onmouseup",function(){
     if (!oEvent) oEvent=window.event;   
        if (oEvent.button==2) alert("RMouse up!");
    },this);
    楼主得试下.
      

  2.   

    addListener( String eventName , Function fn , Object scope , Object options ) : void 
    加入一个事件处理函数。{@link #on}是其简写方式。Append... 
    加入一个事件处理函数。on是其简写方式。Appends an event handler to this element. The shorthand version on is equivalent. 
    参数项: 
    eventName : String 
    事件处理函数的名称。The type of event to handle 
    fn : Function 
    事件处理函数。该函数会送入以下的参数:The handler function the event invokes. This function is passed the following parameters: 
    evt : EventObject 
    用于描述这次事件EventObject的事件对象。The EventObject describing the event.
    t : Element 
    事件源对象,类型是Element The Element which was the target of the event. 注意该项可能会选项delegate筛选而发生变化Note that this may be filtered by using the delegate option.
    o : Object 
    调用addListener时送入的选项对象The options object from the addListener call.
    scope : Object 
    (可选的) 事件处理函数执行时所在的作用域。处理函数“this”的上下文。(optional) The scope (The this reference) of the handler function. Defaults to this Element. 
    options : Object 
    (可选的) 包含句柄配置属性的一个对象。该对象可能会下来的属性: (optional) An object containing handler configuration properties. This may contain any of the following properties: 
    scope {Object} : 事件处理函数执行时所在的作用域。处理函数“this”的上下文环境。The scope in which to execute the handler function. The handler function's "this" context. 
    delegate {String} : 一个简易选择符,用于过滤目标,或是查找目标的子孙。A simple selector to filter the target or look for a descendant of the target 
    stopEvent {Boolean} : true表示为阻止事件。即停止传播、阻止默认动作。True to stop the event. That is stop propagation, and prevent the default action. 
    preventDefault {Boolean} : true表示为阻止默认动作。True to prevent the default action 
    stopPropagation {Boolean} : true表示为阻止事件传播。True to prevent event propagation 
    normalized {Boolean} : false表示对处理函数送入一个原始、未封装过的浏览器对象而非标准的Ext.EventObject。False to pass a browser event to the handler function instead of an Ext.EventObject 
    delay {Number} : 触发事件后处理函数延时执行的时间。The number of milliseconds to delay the invocation of the handler after te event fires. 
    single {Boolean} : true代表为事件触发后加入一个下次移除本身的处理函数。True to add a handler to handle just the next firing of the event, and then remove itself. 
    buffer {Number} : 若指定一个毫秒数会把该处理函数安排到Ext.util.DelayedTask延时之后才执行。如果事件在那个事件再次触发,则原处理器句柄将不会 被启用,但是新处理器句柄会安排在其位置。Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is not invoked, but the new handler is scheduled in its place. 
    不同配搭方式的选项 Combining Options
    下面的例子,使用的是on的简写方式。和addListener是等价的。利用参数选项,可以组合成不同类型的侦听器: In the following examples, the shorthand form on is used rather than the more verbose addListener. The two are equivalent. Using the options argument, it is possible to combine different types of listeners:这个事件的含义是,已常规化的,延时的,自动停止事件并有传入一个自定义的参数(forumId)的一次性侦听器。这些事件设置在处理函数(也就是第三个的参数)中也可以找到的。A normalized, delayed, one-time listener that auto stops the event and adds a custom argument (forumId) to the options object. The options object is available as the third parameter in the handler function. 代码:Code:                                                
    返回值: 
    void