PDA

View Full Version : [CLOSED] Ext.Array.insert BUG/ Throws exception



klodoma1
20 Oct 2015, 4:47 AM
This one works correctly:



Ext.Array.insert( [1,2], 1, 'x' ); returns [1, 'x', 2] -correct


These ones, throws exception:
Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type


Ext.Array.insert( [1,2], 0, 'x' );
Ext.Array.insert( [1,2], 2, 'x' );



https://fiddle.sencha.com/#fiddle/voa

Am I using it the wrong way? Or it's a bug?

Tested in Ext 4,5 && 6.

joel.watson
20 Oct 2015, 7:11 AM
Hi--

Per the docs, the "items" argument should be an array:
http://docs.sencha.com/extjs/4.2.4/#!/api/Ext.Array-method-insert

Thanks!
Joel