PDA

View Full Version : Ext.data.TreeStore expand one level



fremme
22 Nov 2012, 4:05 AM
Hello all!

I'm using 4.1 - and the Ext.data.TreeStore.

Depending on how many records - I would like to expand all or only the first level of the tree (like in the image below).

Today - I'm doing a expandAll if the number of records is less than (50) from a listeners->load in the Ext.data.TreeStore.

But would like to be able to auto expand only first level under the top node!
40247


Also: Is there a simple way to find the total number of records in the TreeStore ?
Today I do a recursive Ext.each(records to find all records in all levels - but there has to be a better way :">

mitchellsimoens
24 Nov 2012, 6:27 AM
I would use the expanded config that is being returned to tell that node to be expanded or not.

fremme
25 Nov 2012, 12:52 AM
Thank you!
I ended up using a Ext.ux.TreeFilter and filter on node.parentNode.data.depth.