PDA

View Full Version : Ext.util.KeyMap on document



skirtle
24 Dec 2011, 8:03 AM
Not sure whether this is technically a bug but it is a backwards-compatibility problem I hit.

In ExtJS 4.0.7 this works:


Ext.create('Ext.util.KeyMap', document, {
...
});

In 4.1.0-beta-1 that throws an error, I've had to change it to this:


Ext.create('Ext.util.KeyMap', Ext.get(document), {
...
});

Is there a better way to do this? Note that this code works even when it isn't wrapped in an Ext.onReady, so it isn't equivalent to using the document body.

Animal
24 Dec 2011, 8:55 AM
The new constructor has been standardized to use a single argument as is now standard in ExtJS.

Use the target: document config in a single config object.

This class has been around since yui-ext, and that constructor signature really had to change.

Needs some tweaks to the tests which route it through the legacy constructor to maintain backward compatibility as we must.

skirtle
24 Dec 2011, 9:28 AM
Thanks. Switched my code to target and binding and everything looks a lot healthier for it.

tvanzoelen
27 Dec 2011, 5:21 AM
Thanx, this one solved. Then backward compatibility aint good on this point.