When I call itemClick() in an Ext.tree.Panel I would like to render some arbitrary nodes.
Lets say, when I click on a node I want to highlight all of its children yellow :
simples.
I know how to render the clicked node. That's easy :
itemclick: function(dv, record, item, index, e) {
//HTMLElement
item.style.color="RED";
Item is just a HTMLElement which can get its style changed.
I also managed to figure out that I can also access data from the store like so :
itemclick: function(dv, record, item, index, e) {
//View --> store
dv.store.data.items[4]
The data items are just the Ext.data.Model objects i think. I can't see any hook where I can add styling to the item objects however :(
I also looked at doing an 'up' query and calling findChild(..) on tree panel:
itemclick: function(dv, record, item, index, e) {
//Ext.data.NodeInterface
var panel = dv.up('panel');
var rn = panel.getRootNode();
var r = rn.findChild("name", "MYNODE");
r.data.cls = 'my_class';
There is a cls 'hook' where I can set class values. However the rendering does not seem to happen. Also the findChild method only returns one value, and there is no findChildren (which is really perplexing. Why would ExtJS ommit something like that? )
This event callback method really puzzles me. I somehow need a link between the HTMLElement and the data items or store. All these approaches seem to lead to a dead end for me.
UPDATE : In the third example I can call panel.getView().refresh(); and this will update the UI. So now the only problem I have is finding a method like getChildren(..)