Opened 14 years ago

Closed 14 years ago

#6763 closed defect (invalid)

Tree: not fully compliant to the store.Write API

Reported by: [email protected] Owned by:
Priority: high Milestone:
Component: Dijit Version: 1.1.0
Keywords: store tree api parentInfo Cc: Sam Foster, Jared Jurkiewicz
Blocked By: Blocking:


As talked on IRC to sfoster, here is what I found being "wrong" with dijit.Tree. The defines for the newItem(item, parentInfo) method, that parentInfo looks like {parent : /*item*/, attribute : /*string*/}

The dijit.Tree instead tests for parentInfo.item, which should be parentInfo.parent. This can be seen in Dojo 1.1.1 on line 1111 of dijit.Tree

this.onChildrenChange(parentInfo.item, children);

When using an own store this leads to misbehaviour when programmatically adding items to the store.

Change History (2)

comment:1 Changed 14 years ago by bill

Cc: Jared Jurkiewicz added; [email protected] removed
Reporter: changed from guest to [email protected]
Summary: dijit.Tree not fully compliant to the store.Write APITree: not fully compliant to the store.Write API

Hmm, so I think this is based on the notification API (see Notifcation.js) which defines:

//	parentInfo:
//   ... The structure passed in is as follows:
//		{
//			item: someItem,							//The parent item
//			attribute:	"attribute-name-string",	//The attribute the new item was assigned to.

I see the code you are talking about in the Write API:

//	parentInfo:
//		...  The structure
//		of the object is as follows:
//		{
//			parent: someItem,
//			attribute: "attribute-name-string"
//		}

but not sure how it's relevant here. Is there a test case of something that's failing?

You can ping me too on IRC (wildbill).

comment:2 Changed 14 years ago by bill

Resolution: invalid
Status: newclosed

Ok, we talked on IRC... this was actually a problem w/the custom store not implement Notification correctly, given the confusing disparity between the parentInfo structure used in the Write API vs. the Notification API.

Note: See TracTickets for help on using tickets.