Sencha touch Ext.createDelegate()迁移sencha touch 2应用程序
这行代码是我在Sencha TOuch 1.1应用程序中的代码:Sencha touch Ext.createDelegate()迁移sencha touch 2应用程序,sencha-touch,sencha-touch-2,Sencha Touch,Sencha Touch 2,这行代码是我在Sencha TOuch 1.1应用程序中的代码: var a=Ext.createDelegate(photoSuccess,this,[],true); 我怎么能在Sencha Touch 2中做到这一点?我试过这种机智,但运气不好: var a=Ext.bind(photoSuccess,this); 谢谢 var a=Ext.createDelegate(photoSuccess,this,[],true); 是 或者只是 var a=Ext.bind(photoS
var a=Ext.createDelegate(photoSuccess,this,[],true);
我怎么能在Sencha Touch 2中做到这一点?我试过这种机智,但运气不好:
var a=Ext.bind(photoSuccess,this);
谢谢
var a=Ext.createDelegate(photoSuccess,this,[],true);
是
或者只是
var a=Ext.bind(photoSuccess,this);
下面是一个工作示例
var photoSuccess = function(foo) {
console.log('foo', foo);
}
var a = Ext.bind(photoSuccess, window);
a(1) //outputs: foo 1
换句话说,您的调用应该有效。Ext.bind()
是Ext.createDelegate()的继承者。
。您的Ext.bind()有什么问题?你期望什么?实际发生了什么?
var photoSuccess = function(foo) {
console.log('foo', foo);
}
var a = Ext.bind(photoSuccess, window);
a(1) //outputs: foo 1