1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    70
    Vote Rating
    0
    skyey is on a distinguished road

      0  

    Question event question?

    event question?


    Code:
     Ext.onReady(function(){
        Ext.get('id').on('click',function(){
               Ext.MessageBox.show({
                   title: 'Address',
                   msg: 'Please enter your address:',
                   width:300,
                   buttons: Ext.MessageBox.OKCANCEL,
                   multiline: true,
                   fn: showResultText,
                   animEl: 'id'
               });
        });
    
        test();
               
        function showResultText(btn, text) {     
            if(btn=="ok")
              return true;
       }
       
       
     });
    how to hook test() function before execute showResultText callback?

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Bah
    Posts
    434
    Vote Rating
    0
    efege is on a distinguished road

      0  

    Default


    In your code, you define test as an Ext.MessageBox object, not as a function. What does test() mean then?
    Fernando G

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    70
    Vote Rating
    0
    skyey is on a distinguished road

      0  

    Default


    i changed ,please see

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Location
    Bah
    Posts
    434
    Vote Rating
    0
    efege is on a distinguished road

      0  

    Default


    Ok, so now... would you please clarify your question? I'm not sure what you mean. What are you trying to do?
    Fernando G

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,937
    Vote Rating
    635
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    You want to run test() before showResult()? If so, this should work:

    Code:
     Ext.onReady(function(){
        Ext.get('id').on('click',function(){
               Ext.MessageBox.show({
                   title: 'Address',
                   msg: 'Please enter your address:',
                   width:300,
                   buttons: Ext.MessageBox.OKCANCEL,
                   multiline: true,
                   fn: function(btn, text) { test(); showResultText(btn, text); },
                   animEl: 'id'
               });
        });
               
        function showResultText(btn, text) {     
            if(btn=="ok")
              return true;
       }
       
       
     });

Thread Participants: 2