PDA

View Full Version : add a class to treeNode



flamant
26 Aug 2010, 1:09 AM
Hi,
I try to add a class to a treeNode and it doesn't work
Here is the code



click: function(node) {
if (selectedDataEntryNode!=undefined)
selectedDataEntryNode.ui.removeClass('redText');
selectedDataEntryNode = node;
var currentClass = selectedDataEntryNode.attributes.cls;
selectedDataEntryNode.ui.removeClass(currentClass);
selectedDataEntryNode.ui.addClass('redText');
}


with CSS :



.redText {
color: red;
}


it doesn't even turns in red I click on the node. Thank you for your help

aconran
26 Aug 2010, 12:20 PM
Are you trying to just change the text color of the selected node in the tree?

We already maintain CSS classes for you to do this...

Try something like:


.x-tree-node .x-tree-selected span {
color: red;
}

flamant
27 Aug 2010, 12:37 AM
Thank you very much Aconran it works fine