ENART.HZRN.COM
welcome to my space
X
Search:  
 HOME   Is there an event for closing a tab?
Is there an event for closing a tab?
Published by: mike 2010-03-15
Welcome to:enart.hzrn.com

  • I'm trying to run some code when closing a tab, is there an event for this? I've tried onbeforeclose and onbeforedestroy, but they don't seem to have an effect.


  • Is this 1.x or 2.0? No event names are preferenced by 'on' in either version.


  • Exactly! That's the right place.


  • What you're probably seeing are the functions that handle processing for some event. For example for an event named 'click', there may be a function called 'onClick' that's doing some processing related to the event.


  • Thanks! I'm starting to understand now... I've sort of just started out blindly copying from the Feed viewer example and working on it until I've gotten something that works reasonably well, but I don't always understand why things are done exactly the way they are. I think the appropriate place for this would be 'listeners' in the objects config:


    EditForm.superclass.constructor.call(this, {
    bodyStyle: 'padding: 5px 5px 5px 5px',
    closable: true,
    autoScroll: true,
    border: false,
    bodyBorder: false,
    deferredRender: false,
    tbar: [ this.saveButton ],
    items: [ this.form ],
    listeners: {
    'beforedestroy': function() {
    tinyMCE.removeInstances(this.id);
    }
    },
    scope: this
    });


  • Event names in Ext do NOT begin with on. There are panel events: beforeclose, close.


  • I'd seen some events starting with 'on' when extending with ext.extend in the Feed panel example and mistakenly assumed this meant other events was also prefixed with on when extended this way.

    Now it works:


    Ext.extend( EditForm, Ext.Panel, {
    beforeDestroy : function(e) {console.log('It works!')}
    });


  • I'd seen some events starting with 'on' when extending with ext.extend in the Feed panel example and mistakenly assumed this meant other events was also prefixed with on when extended this way.

    Now it works:


    Ext.extend( EditForm, Ext.Panel, {
    beforeDestroy : function(e) {console.log('It works!')}
    });


    You override panel's beforeDestroy method by the above code in fact. Relation of beforeDestroy to events is only that that it is called from beforedestroy event listener.

    Beware, overriding default methods of Ext components can be dangerous. Of course, you can do so but you must be sure that you know what you are doing.





  • Problem interacting with flash application
    Correct sequence for grid?

    You are looking at:enart.hzrn.com's Is there an event for closing a tab?, click enart.hzrn.com to home
  • x factor tonight
  • what are your favorite t v shows
  • sons of anarchy season finale song
  • what is wrong with peyton on one tree hill and why did the season stop
  • hills fans if you saw the hills aftershow where holly talks about her sister and spencer 039 s wedding
  • what do u think about this one tree hill season
  • what is the house eppisode where he hires or decides who makes it into his new team
  • has anyone watched heros season 3 recently
  • mad tv and snl fans which episode is this show from
  • what 039 s so great about the hills
  • what is the script of the scene in either family guy or the simpsons when dog heaven is described
  • who was the screenwriter for the gentle down ii
  • does grissom off of csi really leave
  • what show is worse lost house or monk
  •  
  • here are the songs for tonight on x factor 2 each
  • house fans please help me
  • instrumental trumpet opening usually associated with a striptease
  • who loved twilight and wants to see it again
  • when does vampire knight 2nd season show on the internet
  • songs in a simpsons episode
  • what 039 s the deal with cbs if nbc abc can offer full episodes why can 039 t cbs
  • i am doing my drama exma today help
  • what is the name of this episode of family guy
  • what is your favorite tv show why
  • which episode of ncis does ziva have a crush on a guy
  • greys anatomy quote episode in the midnight hour
  • where can i watch gossip girl series 2 episode 12
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 enart.hzrn.com        Site made:CFZ