Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15847 closed defect (fixed)

Tree: ObjectStoreModel doesn't observe async queries

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.8.1
Component: Dijit Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

The observe() method hangs off of the promise returned by store.query(), not the promise's resolved value, so in this code:

when(
	this.childrenCache[id] = this.store.getChildren(parentItem),
	lang.hitch(this, function(children){
		//console.log("queried children of " + id + ": ", children);

		// Setup listener in case children list changes, or the item(s) in the children list are
		// updated in some way.
		if(children.observe){

children.observe() is always null. Thus the Tree won't get notifications about updates to the data store.

Change History (4)

comment:1 Changed 7 years ago by bill

Description: modified (diff)
Milestone: tbd1.8.1

comment:2 Changed 7 years ago by bill

Resolution: fixed
Status: newclosed

In [29499]:

Fix data store update notifications for when store is asynchronous. Still needs a good test case. Fixes #15847 on trunk/ !strict. Also fixing the ObjectStoreModel doc.

comment:3 Changed 7 years ago by bill

In [29500]:

Fix data store update notifications for when store is asynchronous. Still needs a good test case. Fixes #15847 on 1.8/ branch !strict. Also fixing the ObjectStoreModel doc.

comment:4 Changed 7 years ago by jzw

hi, when I follow http://dojotoolkit.org/documentation/tutorials/1.8/store_driven_tree/ to add a new node, it cannot trigger Tree's _onItemChildrenChange。

The demo generate the item id at the client code, if I want to generate the item id at the server side, how should I write the code?

Note: See TracTickets for help on using tickets.