Results 1 to 5 of 5

Thread: event question?

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    70
    Vote Rating
    0
      0  

    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
      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
      0  

    Default

    i changed ,please see

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Location
    Bah
    Posts
    434
    Vote Rating
    0
      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
    18,367
    Vote Rating
    858
      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;
       }
       
       
     });

Posting Permissions

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