Hybrid View

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    18
    Vote Rating
    0
    Answers
    1
    jiancha is on a distinguished road

      0  

    Default Answered: Issue: Parameters in Event function

    Answered: Issue: Parameters in Event function


    Hello,

    I am new to Sencha Touch, I can't figure out which params and in which order should be used in Event function: e.g.

    Code:
    onDoubleTap: function(event, html, obj)
    Code:
    onDragend: function(draggable, event)
    It seems param event is not always the first param.
    where can I check params for each event or where defines how to add params

    Thanks a lot !
    best regards !

  2. If you are listening to an event on an Ext.Element instance, the params are always:

    Code:
    tap: function(e, node, options) {
    
    }
    If you are listening to an event on a component, we try to keep a consistent signature. In most cases, the component is the first argument, then any related arguments after that:

    Code:
    hiddenchange: function(component, floating) {
    
    }
    Unfortunately in some cases, this does not happen. We are improving the event signatures drastically in ST2 before GA.

  3. #2
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    Answers
    93
    rdougan will become famous soon enough

      0  

    Default


    If you are listening to an event on an Ext.Element instance, the params are always:

    Code:
    tap: function(e, node, options) {
    
    }
    If you are listening to an event on a component, we try to keep a consistent signature. In most cases, the component is the first argument, then any related arguments after that:

    Code:
    hiddenchange: function(component, floating) {
    
    }
    Unfortunately in some cases, this does not happen. We are improving the event signatures drastically in ST2 before GA.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 1