I want to add a listener which listens to updatedata event in my custom component.
I have several ways to do it, but don't know which one is correct:
inside config
config:{ updatedata:"dataUpdated" }, dataUpdated: function() { ......... }
2.
config:{
listeners:{
updatedata: function(thisComponent, newData, eOpts){
..............
}
}
}
Also, do I need to call something like: me.updatedata() within the listener function?
Please correct me if something wrong in my code.
Thank you.
You would wrap
listeners
inconfig
when executingExt.define
. DuringExt.create
, or initems
you would place them at the root of passed object (not wrapped inconfig
)Events are explained in details in Sencha Touch Event Guide