在哪里和如何以正确的方式写更新的事件 [英] where and how to write updatedata event in the correct way
问题描述
我有几种方法可以做,但是不知道哪一个是正确:
-
内部配置
配置:{
updatedata:dataUpdated
},
dataUpdated:function(){
.........
}
2。
config:{
听众:{
updatedata:function(thisComponent,newData,eOpts){
..............
}
}
另外,我需要调用以下内容:
me.updatedata()听众功能?
如果我的代码出现问题,请更正我。
谢谢。 >
您将在 config $中包装
) listeners
c $ c>执行 Ext.define
时。在 Ext.create
或项目
中,您将把它们放在传递对象的根目录(不包含在code> config
事件在 Sencha Touch活动指南
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
in config
when executing Ext.define
. During Ext.create
, or in items
you would place them at the root of passed object (not wrapped in config
)
Events are explained in details in Sencha Touch Event Guide
这篇关于在哪里和如何以正确的方式写更新的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!