I'm trying to covert a flat store (Ext.data.Store) to a tree store (Ext.data.TreeStore) by some logic,

For that matter I decided to create a new class (called NetworksTreeStore) that extends Ext.data.TreeStore and will get (or contain) the flat store and somehow (that's where I need help) convert it to a tree store.

What is the easiest and the right way to implement it?