tags:

views:

1165

answers:

1

Using Dojo 1.3, after adding a child (i.e. folder or item) to a tree, is there a way to have it reflected immediately via refresh or some other method?

+1  A: 

From the official Dojo manual

Updating a Tree

People often ask:

how do I update a tree (adding or deleting items?)

You can't update the tree directly, but rather you need to update the model. Usually the model is connected to a data store and in that case you need to update the data store. Thus, you need to use a data store that allows updates (through it's official API), like dojo.data.ItemFileWriteStore.

how do I refresh a Tree from the store?

This isn't supported. The store needs to notify the tree of any changes to the data. Currently this is really only supported (out of the box) by dojo.data.ItemFileWriteStore, as setting up a client-server dojo.data source where the server notifies the client whenever the data has changed is quite complicated, and beyond the scope of dojo, which is a client-only solution.

kazanaki