I am trying to change the color of visited node in Tree panel. I ma able to change the color and style of selected node and on doing mouse hover using belw CSS: .x-grid-cell-inner-treecolumn:hover { }
.x-grid-row-selected .x-grid-cell-inner-treecolumn
Can any one please help me how to change visited node color like we have in html link.
Any thoughts on this would be higly appreciated.
Thanks in advance for the help.
解决方案
I can give you an idea, but no final implementation.
What you need is an additional boolean field in the store, which stores whether the node has been visited or not:
name:"hasBeenVisited",
type:"bool",
defaultValue:false,
persist:false
In the grid, you need the RowModel selection model and have to bind to the select event of that selection model and tell the record that it has been visited:
select:function(selModel, record) {
record.set("hasBeenVisited",true);
}
In the grid, you add a getRowClass function:
viewConfig:{
getRowClass:function(record) {
return record.get("hasBeenVisited")?"hasBeenVisitedCls":"";
}
}
and then you have to add to your CSS a special color:
.hasBeenVisitedCls .x-grid-cell-inner-treecolumn {
color:purple
}