Results 1 to 3 of 3

Thread: about the callback when window have show

  1. #1
    Ext User kkbear's Avatar
    Join Date
    Aug 2007
    Posts
    43
    Vote Rating
    0
      0  

    Default about the callback when window have show

    here is my code
    PHP Code:
    dialog = new Ext.Window({.....});
    dialog.show({
        
    callback:function(){
            
    doing something!
        }
    }); 
    it not work, how can i do it? thx

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    show() has parameters animateTarget, cb and scope.

    You should use:

    Code:
    dialog = new Ext.Window({.....});
    dialog.show(undefined, function(){
      // doing something!
    });

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2015
    Location
    UK
    Posts
    22
    Vote Rating
    0
      0  

    Default Ext JS 6 - Classic - window.show() - callback

    I had a similar issue when using window.show() method.

    I attempted the following two methods which didn't work:

    Code:
    1st approach:
    var callback = function() {
    console.log('Window has been displayed')
    }
    window.show(callback) or window.show(callback, this)
    // I assumed not passing the animate param wouldn't matter as long as the callback argument gets detected as a function
    Code:
    2nd approach: 
    window.show({
    callback: function() {
    console.log('Window has been displayed');
    })
    But the following approach as per Condor's suggestion worked:
    Code:
    window.show(undefined, function(){
     console.log('Window has been displayed');
    });

Posting Permissions

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