PDA

View Full Version : How to get tree nodes which are shown in viewport



hongmin.li@arrisi.com
3 Jun 2013, 2:34 AM
Hi, how can I get the tree nodes which are shown in viewport?
for example:
44149
i want to get Root, Node_1, Node_2, Node_2_1, Node_2_2 and Node_3, and when I move the scroll bar,like following:
44150 i want to get Node_6 to Node_11.

I don't know how to do this, any ideas will be appreciate.

thanks

slemmon
5 Jun 2013, 9:49 AM
There's not a way to do this currently directly from the framework - no convenience method like that.

All I've been able to come up with, though I've not tried it, is to get the Region (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.view.Table-method-getRegion) of the tree view and loop through the tree nodes (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.NodeInterface-method-cascadeBy) and see if their Region intersects (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.util.Region-method-intersect) the tree view's Region.