The TreeNodeUI isn't initializing it's disabled state properly. In fact, it doesn't need to have disabled state at all. Another user has also run into the same bug:
http://extjs.com/forum/showthread.php?t=2548
To repro the bug, create a new TreeNode and pass in a config object with 'disabled=true'. The tree node will still be selectable and the tree node text won't be greyed out.
Here is a patch against the ext-2.2 release:
Code:
Index: source/widgets/tree/TreeNodeUI.js
===================================================================
--- source/widgets/tree/TreeNodeUI.js
+++ source/widgets/tree/TreeNodeUI.js
@@ -55,7 +55,6 @@
// private
onDisableChange : function(node, state){
- this.disabled = state;
if (this.checkbox) {
this.checkbox.disabled = state;
}
@@ -135,12 +134,7 @@
initEvents : function(){
this.node.on("move", this.onMove, this);
- if(this.node.disabled){
- this.addClass("x-tree-node-disabled");
- if (this.checkbox) {
- this.checkbox.disabled = true;
- }
- }
+ this.onDisabledChange(this.node, this.node.disabled);
if(this.node.hidden){
this.hide();
}
@@ -197,14 +191,14 @@
}
if(this.fireEvent("beforeclick", this.node, e) !== false){
var a = e.getTarget('a');
- if(!this.disabled && this.node.attributes.href && a){
+ if(!this.node.disabled && this.node.attributes.href && a){
this.fireEvent("click", this.node, e);
return;
}else if(a && e.ctrlKey){
e.stopEvent();
}
e.preventDefault();
- if(this.disabled){
+ if(this.node.disabled){
return;
}
@@ -221,7 +215,7 @@
// private
onDblClick : function(e){
e.preventDefault();
- if(this.disabled){
+ if(this.node.disabled){
return;
}
if(this.checkbox){
I also suggest that 'onOver' check for the node's disabled state before changing to the 'x-tree-node-over' class.