Opened 9 years ago

Closed 9 years ago

#11861 closed defect (invalid)

dijit.Tree items not expanding after ItemFileReadStore update

Reported by: dimm Owned by: Jared Jurkiewicz
Priority: high Milestone: tbd
Component: DojoX Data Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

Trying to make the tree updating as described in http://docs.dojocampus.org/dojo/data/ItemFileReadStore


<script type="text/javascript">
	var store, treeModel, tree;
	
	function makeTree() {
    	
        store = new dojo.data.ItemFileReadStore({
	        url: nodesUrl,
	        clearOnClose: true,
			urlPreventCache: true
        });

        treeModel = new dijit.tree.ForestStoreModel({
        	store:store,
            query: {
            	type:'container'
            },
            rootId: '',
            rootLabel: 'root',
            childrenAttrs: ["children"]
        });


        tree = new dijit.Tree({
            model: treeModel
        },
        dojo.byId("treeOne"));
        tree.startup();
	}
    dojo.addOnLoad(makeTree);


    function storeUpdate() {
	store.close();
	store.fetch();
    };
    
</script>


After calling storeUpdate() I see the store requests new data, the nodes continue working (the context menu still works) and root node can collapse. But all the nodes in the tree are not collapsing/expanding with error:

dojo.data.ItemFileReadStore: Invalid item argument.
http://o.aolcdn.com/dojo/1.5.0/dojo/data/ItemFileReadStore.xd.js
Line 8

Change History (1)

comment:1 Changed 9 years ago by Jared Jurkiewicz

Resolution: invalid
Status: newclosed

The tree is caching old items that are no longer valid. This isn't a store bug., it is reporting correctly. You need to clear and rebuild the tree completely to get rid of the cached items.

Note: See TracTickets for help on using tickets.