The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

rootsikal (7) [Avatar] Offline
#1
Hi

i'm beginner with ExtJS
I'm reading the Ext JS in Action book.. and also trying to work with the examples

In the Chapter 3,
paragraph 3.1.4 : Burst the bubble
can someone explain to me what the "this" refers in this code?
is it the window or the element from which the event was launch or....?

thanks for your help

Message was edited by:
rootsikal
jesus.garcia (463) [Avatar] Offline
#2
Re: ExtJS In Action - Example Chapter 3
"this" is a keyword is a reference to the object scope for which a method is executing and is an Object Oriented JavaScript idiom.

See: http://howtonode.org/what-is-this
rootsikal (7) [Avatar] Offline
#3
Re: ExtJS In Action - Example Chapter 3
thanks a lot...

i know a little about "this"...

but, in my post, i was just wondering what was refering the "this" in the particular case of the example in ExtJS in Action - Chapter3
jesus.garcia (463) [Avatar] Offline
#4
Re: ExtJS In Action - Example Chapter 3
'this' refers to the instance of Ext.Element that is firing the event.
rootsikal (7) [Avatar] Offline
#5
Re: ExtJS In Action - Example Chapter 3
ok...

The Ext.Element which is firing the Element is the "MyHref", isn't it?( .. the one wich launch the function when right-cliking)

if yes, so "this" = elRef ?
if yes, is it the same to write "this.ctxMenu.show(this)" instead of "this.ctxMenu.show(elRef)" ?