skirtle
23 Dec 2011, 2:41 PM
Having problems with 4.1.0-beta-1 and tree node order in Chrome. Reproduced the problem on both Linux and Windows but only in Chrome.
Ext.create('Ext.tree.TreePanel', {
height: 200,
renderTo: Ext.getBody(),
width: 200,
root: {
text: 'Tree 1',
children: [
{text: '01', leaf: true},
{text: '02', leaf: true},
{text: '03', leaf: true},
{text: '04', leaf: true},
{text: '05', leaf: true},
{text: '06', leaf: true},
{text: '07', leaf: true},
{text: '08', leaf: true},
{text: '09', leaf: true},
{text: '10', leaf: true},
{text: '11', leaf: true}
]
}
});
I debugged as far as this line in Ext.data.TreeStore:
Ext.Array.sort(records, me.sortByIndex);
Seems to me that sortByIndex is returning 0 for all comparisons, so the order will depend on the sorting algorithm used by the browser. In the case of Chrome that means things get messed up.
Ext.create('Ext.tree.TreePanel', {
height: 200,
renderTo: Ext.getBody(),
width: 200,
root: {
text: 'Tree 1',
children: [
{text: '01', leaf: true},
{text: '02', leaf: true},
{text: '03', leaf: true},
{text: '04', leaf: true},
{text: '05', leaf: true},
{text: '06', leaf: true},
{text: '07', leaf: true},
{text: '08', leaf: true},
{text: '09', leaf: true},
{text: '10', leaf: true},
{text: '11', leaf: true}
]
}
});
I debugged as far as this line in Ext.data.TreeStore:
Ext.Array.sort(records, me.sortByIndex);
Seems to me that sortByIndex is returning 0 for all comparisons, so the order will depend on the sorting algorithm used by the browser. In the case of Chrome that means things get messed up.