1

这行代码就是我在 Sencha TOuch 1.1 应用程序中的代码:

var a=Ext.createDelegate(photoSuccess,this,[],true);

我怎么能在 Sencha Touch 2 中做同样的事情?我试过这个没有运气:

var a=Ext.bind(photoSuccess,this);

谢谢!

4

1 回答 1

3

的有效表示

var a=Ext.createDelegate(photoSuccess,this,[],true);

var a=Ext.bind(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

换句话说,你的电话应该有效

于 2012-05-11T05:32:35.977 回答