PDA

View Full Version : [CLOSED]Treepanel returns wrong order of childNodes on Webkit browsers



marcing
21 Jul 2010, 4:48 AM
Ext version tested:

Ext 3.2 rev 6798


Adapter used:

ext


Browser versions tested against:

Firefox 3.6 (works correctly)
Chrome 5 (works incorrectly)
Safari 4 (works incorrectly)



Description:

Webkit browsers report incorrect nodes order when trying to read using getRootNode().childNodes


Test Case:

Attached example. Unpack to examples/tree (overwrite reorder.js)


Steps to reproduce the problem:

Move "cat1" before "cat2", "cat3" and "cat4"
Click Save button
Notice the difference of order in alert message (compare result in Firefox and Webkit, it's different)


The result that was expected:

"cat1", "cat2", "cat3", "cat4"


The result that occurs instead:

"cat2", "cat3", "cat4", "cat1"


Screenshot (high resolution included in ZIP file:

attached


Debugging already done:

none


Possible fix:

not provided

evant
21 Jul 2010, 5:50 AM
It's not a bug, you can verify that the child nodes are returned in the correct order, which means the issue occurs in the encoding. In a for in loop, the order isn't guaranteed



The block is executed for each name in the object. The order in which the names are produced is not guaranteed.


From: http://www.crockford.com/javascript/survey.html

marcing
21 Jul 2010, 7:53 AM
Thanks!
You are right, the order is messed up inside Ext.encode();