You found a bug! We've classified it as
EXTJS-20251
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
-
Bug in 6.0.1 caused by compatibility (4.2.1) when adding root node to tree
Hi,
I believe I've discovered a bug in 6.0.1 (commecial) when you try to use setRootNode() on a TreePanel when compatibility is enabled (and set to level 4.2.1). This was discovered because I'm in the process of migrating a 4.2.1 app to 6.0.1.
Here's a stand-alone sample distilled down from the original code in the application that demonstrates the bug:
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script>
var Ext = Ext || {};
Ext.manifest = {
compatibility : {
ext : "4.2"
}
};
</script>
<link rel="stylesheet" type="text/css" href="../extjs6/build/classic/theme-classic/resources/theme-classic-all-debug.css">
<script type="text/javascript" src="../extjs6/build/ext-all-debug.js"></script>
<script>
Ext.onReady(function() {
new Ext.Window({
width : 200, height : 300, title : "Test", layout : "fit",
items : [
{ xtype : "treepanel", id : "myTree",
root : { expanded : true, text : "Starting Root", children : [ ] }
}
]
}).show();
var newRootNode = {
expanded : true, text : "New Root",
children : [
{ leaf : true, text : "leaf1" }
]
};
Ext.getCmp("myTree").setRootNode(newRootNode);
});
</script>
</head>
<body></body>
</html>
With that Ext.manifest setting enabled, you'll see the following error in the Firefox dev console upon page load triggered by the line of code in red:
TypeError: joined is undefined (ext-all-debug.js:82168:1)
I note that the line of code referenced is within a deprecated block, which I'm not familiar with frankly but given the name it seems to me to make sense it's compatibilty-related.
More importantly though, commenting out the Ext.manifest block in my sample causes it to work as expected, so it's seemingly pretty clear-cut. Since my original unaltered code works fine under 4.2.1 it seems unlikely (though not impossible) that I'm doing anything wrong, and from reading the docs I don't see anything to lead me to believe anything needs to be changed under 6.0.1, all of which leads me to conclude it likely is a bug in ExtJS itself.
Thanks,
Frank
-
Sencha User
I am experiencing this same issue upgrading from 4.1.2 to 5.1.1. Commenting out my Ext.Manifest line to set compatibility level resolves this issue for me as well. This occurs for me only when collapsing a node in a tree.
-
Sencha - Sustaining Engineer
Thanks for the report! I have opened a bug in our bug tracker.