Login Register

Problems updating multiple Trees with ItemFileWriteStore

Hello all:

I'm pretty new to Dojo, and I'm really impressed with it so far. I've run into a small snag with the Tree widgit though, and was wondering if I'm doing something wrong, or if I've found a bug.

I have an ItemFileWriteStore, reading JSON data from my server. There are two types within this data: 'folders', and 'items'. As you might suspect, an 'item' resides within a folder.

I have two trees. The first tree displays folders, and the item children of the folders. The second tree displays all items.

When I programmatically add an item to the store ('filesStore'), I'm noticing some strange behaviour:

As expected, if I add the item using my filesStore.newItem without the parentInfo params, the second tree displaying only items refreshes just fine, and the first tree does not refresh. So clearly, I need to pass the parentInfo params to refresh the first tree.

When I *do* pass the appropriate parent params, the first tree updates, but now the second tree does not.

Here's my test code (sorry, it's a bit large and hacky - I just threw it together to show you what I'm talking about):

http://mikeconley.ignorelist.com/files/demo.html

JSON Data: http://mikeconley.ignorelist.com/files/test.json

So clicking on 'Add Left' adds the tree with the parentInfo only to the left tree. Reading filesStore._getNewFileContentString() after adding the new item seems to show that the item has been properly added to the store, and that the second tree querying for type:'item' should display it.

Thoughts?

Thanks so much,

-Mike C

Some associated reading...

I just finished reading this: http://dojotoolkit.org/2008/02/24/dijit-tree-and-dojo-data-dojo-1-1-mode...

Seems very related to my problem, but I couldn't find a solution in there.

-Mike