So far the "good enough" solution is to
- Turn the tree panel into a class
Each time the data changes:
- Delete the previous instance (if any) of the tree panel
- Instantiate a new tree panel
Not the "Ext JS 4" way but it gets the job done. Unless anyone can enlighten me with the correct way of doing things, I'm flagging this as the answer.
var panel = Ext.ComponentQuery.query('panel#categorysearch')[0];
//destroy the tree panel
panel.remove('categorysearchtree', true);
//create a new one
var tree = Ext.create('MyApp.view.CategorySearchTreePanel', {
root: {
text:'Services',
expanded:true,
children: jsonResponse.categoryTree.data
}
});
panel.add(tree);