我使用这个提示语句并想将另一个变量传递给回调函数:
正常行为:
Ext.MessageBox.prompt('Name', 'New folder name:', this.callbackCreateFolder);
callbackCreateFolder: function(btn, text) {
console.log( btn ); // value as expected
console.log( text ); // value as expected
}
我想要的是:
Ext.MessageBox.prompt('Name', 'New folder name:', this.callbackCreateFolder(oRecord));
callbackCreateFolder: function(btn, text, oRecord) {
console.log( btn ); // undefined
console.log( text ); // undefined
console.log( oRecord ); // value as expected
}
将附加参数传递给函数的最佳方法是什么?