POLALA.COM
welcome to my space
X
Welcome to:polala.com
Search:  
 HOME   Object Oriented with event handler. Scope problem?

Object Oriented with event handler. Scope problem?

Published by: admin 2009-01-07
  • Hi.
    I don't understand the behaviour and/or the logic behind these lines of code.

    Here it's a working example:

    function ClassWindow()
    {
    this.win = new Ext.Window({
    //...
    });

    //this.win.on('beforerender', this.myCustomHandler, this.win);
    //this.win.on('beforerender', this.myCustomHandler, this);
    this.win.on('beforerender', myCustomHandler, this);

    function myCustomHandler()
    //this.myCustomHandler= function()
    {
    alert('OK')
    }
    }
    Please, note the commented code.
    These are combinations of what I've tried thinking they are good solutions.
    I think the handler works also when I enable "this.win.on('beforerender', this.myCustomHandler, this.win);" or "this.win.on('beforerender', this.myCustomHandler, this);" in combination with "this.myCustomHandler= function()" (that is the commented lines).
    Gimme Some Closure! -- Object-oriented JavaScript & Ajax Callbacks ::
    Sep 1, 2008 //an associative array, so that event handlers can find them A closure is a variable that is local to the object scope (meaning it can't
    http://knol.google.com/k/glen-ford/gimme-some-closure-object-oriented/27lm3zg1hrg7v/4
    HOME
    this is totally gonna work… » Blog Archive » Using Closures To ::
    Dec 14, 2005 But if, in Java, you did just pass the method (via object reflection), you’d have the same problem you do here. It _is_ an issue of scope,
    http://alexvollmer.com/index.php/2005/12/14/using-closures-to-support-object-oriented-ajax/
    HOME
    Indeed, they don't work as expected, returning me an error.

    Is it a pure Javascript OO issue? Or a misunderstand of how Ext works? Or simply a scope problem?
    :-/:-/:-/

    Thanks in advance


  • It's likely a scope issue. Have you read anything from this thread (http://extjs.com/forum/showthread.php?t=6336) so that you understand scope.





  • Where's The Advantage In Windows Genuine Advantage?
    Stocks Bounce After S&P Joins Bear Market
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Object Oriented with event handler. Scope problem? , Please add it free.
  • would getting a tattoo on my shouldeer hurt worse than any other place
  • where are the worst places to get a tattoo as far as pain
  • tattoo hurt
  • what do you think would be the worst place to get a tattoo
  • where is the worst best place to get a tatto at on your body
  • whats your pet hate about hairdressers
  • should churches have their tax exempt status removed
  • which do you think will outlast the other homouality or religion
  • i get pimples every 3 days im 16 what foods should i avoid and what is the cause of acne and pimples plz help
  • what do you think about gay marriage
  • i rented snow white the 7 dwarves and it turned out to be a o should i sue the rental place
  • where 039 s the best place to get a tattoo
  • what part of the body is the easiest to make bleed what part of the body bleeds most profusely when cut
  • what should i expect when i get my nose and ears pierced tomorrow

  • is my fashion sense 039 white girl prissy 039
  • birthmark on my leg
  • preventing blisters from shoes
  • what is the best way to treat tennis elbow
  • worst place to get a tattoo
  • how can you reduce the size of an abdominal hernia
  • i m having something like pimples which leaves little holes what do i do
  • can a later in life circumcision have anything to do with delayed puberty
  • getting a pair of girl pants to match my style where and what size
  • feeling that my legs are in knots when laying in bed
  • abdominal pain constipation
  • help me improve my look picture
  • how does a sperm works can you explain it more detailly
  • About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008polala.com All Rights Reserved