PDA

View Full Version : how to set the tree node invisible?



cwtuan
23 Jul 2012, 6:33 PM
I want to make a tree node invisible but still exist in store.
That is, the node is not removed.
Users can't see the node on the tree temporarily, but program can still access every node on the tree store.

I couldn't find any method in nodeInterface to make it possible.

sword-it
24 Jul 2012, 2:08 AM
hi cwtuan,

Unfortunately there is no way to hide a single node in Ext 4.x, but you can find some stuff here http://www.sencha.com/forum/showthread.php?142704-Show-Hide-of-the-tree-node-in-ExtJS-4

cwtuan
24 Jul 2012, 3:06 AM
A workaround in the link works. But, it's slow in IE.




setNodeVisible: function(nodeId, visible) {
var node = this.getNodeById(nodeId),
view = this.getView(),
el = Ext.fly(view.getNodeByRecord(node));


el.setVisibilityMode(Ext.Element.DISPLAY);
el.setVisible(visible);
}



Will this function be supported by ExtJS in the future?