Opened 11 years ago

Closed 11 years ago

#6763 closed defect (invalid)

Tree: not fully compliant to the store.Write API

Reported by: tf@… Owned by:
Priority: high Milestone:
Component: Dijit Version: 1.1.0
Keywords: store tree api parentInfo Cc: Sam Foster, Jared Jurkiewicz
Blocked By: Blocking:

Description

As talked on IRC to sfoster, here is what I found being "wrong" with dijit.Tree. The dojo.data.api.Write 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 11 years ago by bill

Cc: Jared Jurkiewicz added; tf@… removed
Reporter: changed from guest to tf@…
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 11 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.