View Full Version : [CLOSED]IE 8 callback using bind bug?

26 May 2011, 10:15 AM
In IE 8.0 and version below, if I run the below code:

Product.SaveProduct(product.data, function () {

the code runs. However, if I change the code to:

Product.SaveProduct(product.data, this.onProductSaved.bind(this));

I get an error message: Object does not support this property or method. In IE 9.0, FF and chrome, no problems.

If I change the code to:

Product.SaveProduct(product.data, {scope: me, callback: me.onProductSaved});

Then again, it runs in IE 8, as well as in IE 9 and the rest of the world.

26 May 2011, 2:42 PM
This isn't a bug. The methods have been moved off the function prototype.

If you want to use bind:

Ext.Function.bind(fn, scope, args);

27 May 2011, 10:09 AM
Thanks for your answer, I will stick to my last line of code, passing the callback object.