Dijit.tree - how to update store URL

371 Views Asked by At

I have the following in my HTML file:

<div dojoType='dojox.data.XmlStore' id='navTreeStore' jsId='navTreeStore' url='' label='name'></div>
<div dojoType='dijit.tree.ForestStoreModel' jsId='navTreeModel' store='navTreeStore' query='{}' rootId='NavTree' rootLabel='NavTree' childrenAttrs='childNodes'></div>
<div dojoType='dijit.Tree' id='navTree' model='navTreeModel'></div>

I'd like to be able to alter the store's URL dynamically. I can't seem to be able to achieve that with the following:

var tree = dijit.byId('navTree');

tree.model.store.url = urlAddress;   //new URL
tree.model.store.clearOnClose = true;
tree.model.store.close();
tree.model.store.fetch();

What am I missing?

0

There are 0 best solutions below