Results 1 to 7 of 7

Thread: listener with two function call in ExtJs 4.2

  1. #1

    Default listener with two function call in ExtJs 4.2

    hi community,

    I would like to call a FormField in the listener two separate functions


    example

    {id:'suchFeld08',
    fieldLabel:'Umsatz bis' ,
    labelWidth:66,
    width:164,
    height:25,
    maxLength: 7,
    x:661,
    y:63,
    listeners: tastaturFilter( 0, 1, 0, 0), function2()
    }

    Maybe someone can tell me how this could work

    by programmers

  2. #2
    Ext JS Premium Member
    Join Date
    Jul 2011
    Location
    Hyderabad, India
    Posts
    99
    Answers
    15

    Default

    Hi,

    Sencha Docs: A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once.

    More info: http://docs.sencha.com/extjs/4.2.1/#...-cfg-listeners


    Thanks,
    Md Naveed
    \m/

  3. #3

    Default

    @ mdnaveed42

    went through the docs yesterday and did not even
    found something approaching what brings me further
    First, I check the docs before I post here.

    I have the problem that I have no two insic

    as click and dblclick

    just both functions to be called one after the other.

    by programmers

  4. #4

    Join Date
    Feb 2011
    Location
    Chisinau, Moldova
    Posts
    316
    Answers
    64

    Default

    you mean this?
    Code:
    listeners: {
        'click': function () {
            this.function1();
            this.function2();
        },
        scope: this
    }

  5. #5

    Default

    Quote Originally Posted by chramer View Post
    you mean this?
    Code:
    listeners: {
        'click': function () {
            this.function1();
            this.function2();
        },
        scope: this
    }
    in about...Yes... only without event
    It just two quite normal to be called functionen.


    Code:
    listeners: function1(); function2();
    
    /* OR */
    
    listeners:{function1();function2();}
    How can I call functionen in the listeners two

    programmers

  6. #6

    Join Date
    Feb 2011
    Location
    Chisinau, Moldova
    Posts
    316
    Answers
    64

    Default

    http://docs.sencha.com/extjs/4.2.1/#...-cfg-listeners
    The 'listeners' config it's an object. In Javascript an object is a collection of key-value pairs.
    So it should look like this:
    PHP Code:
    listeners: {
       
    'event1Name': function() {
          
    /*to be executed when event1Name is fired*/
       
    },
       
    'event2Name': function() {
          
    /*to be executed when event2Name is fired*/
       
    }

    Explain what you want to achieve..

  7. #7
    Sencha Premium User
    Join Date
    Apr 2008
    Posts
    504

    Default

    He wants event1Name and event2Name to be the same. He wants to execute two DIFFERENT functions with one 'tap'.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •